if exists (select 1
            from  sysobjects
           where  id = object_id('T_BAS_ENV_STANDARD')
            and   type = 'U')
   drop table T_BAS_ENV_STANDARD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_BAS_LAW')
            and   type = 'U')
   drop table T_BAS_LAW
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_BAS_NEWS')
            and   type = 'U')
   drop table T_BAS_NEWS
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_BAS_NEWSCOMMENT')
            and   type = 'U')
   drop table T_BAS_NEWSCOMMENT
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_BAS_NEWSTYPE')
            and   type = 'U')
   drop table T_BAS_NEWSTYPE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_BAS_RULSINFO')
            and   type = 'U')
   drop table T_BAS_RULSINFO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_BAS_SINFO')
            and   type = 'U')
   drop table T_BAS_SINFO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_DIC_AREACODE')
            and   type = 'U')
   drop table T_DIC_AREACODE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_DIC_GENCATETYPE')
            and   type = 'U')
   drop table T_DIC_GENCATETYPE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_DIC_GENERALCATEGORY')
            and   type = 'U')
   drop table T_DIC_GENERALCATEGORY
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_DIC_POINTSYSTYPE')
            and   type = 'U')
   drop table T_DIC_POINTSYSTYPE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_DIC_STDPOLLCODE')
            and   type = 'U')
   drop table T_DIC_STDPOLLCODE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_DIC_TRADECODE')
            and   type = 'U')
   drop table T_DIC_TRADECODE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_DIC_WSYSTEMRIVER')
            and   type = 'U')
   drop table T_DIC_WSYSTEMRIVER
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_AREAAQIDD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_AREAAQIHH
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_DATADD')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_DATADD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_DATAHH')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_DATAHH
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_POINTAQIDD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_POINTAQIHH
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_STATION')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_STATION
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_SAIR_DATADD')
            and   type = 'U')
   drop table T_ENV_MONI_SAIR_DATADD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_SAIR_DATAHH')
            and   type = 'U')
   drop table T_ENV_MONI_SAIR_DATAHH
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_STATION')
            and   type = 'U')
   drop table T_ENV_MONI_STATION
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_ENTERLIST')
            and   type = 'U')
   drop table T_PS_BAS_ENTERLIST
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_ENTERREMARK')
            and   type = 'U')
   drop table T_PS_BAS_ENTERREMARK
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_FILEINFO')
            and   type = 'U')
   drop table T_PS_BAS_FILEINFO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_FUEL')
            and   type = 'U')
   drop table T_PS_BAS_FUEL
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_LICENCE')
            and   type = 'U')
   drop table T_PS_BAS_LICENCE
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_MATERIALSINFO')
            and   type = 'U')
   drop table T_PS_BAS_MATERIALSINFO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_PRODUCTSINFO')
            and   type = 'U')
   drop table T_PS_BAS_PRODUCTSINFO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_EDS_PRODUCTUNIT')
            and   type = 'U')
   drop table T_PS_EDS_PRODUCTUNIT
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_ENV_MAN_PUBLICINFO')
            and   type = 'U')
   drop table T_PS_ENV_MAN_PUBLICINFO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_ENV_MAN_REPORT')
            and   type = 'U')
   drop table T_PS_ENV_MAN_REPORT
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_ENV_MAN_STANDBOOK')
            and   type = 'U')
   drop table T_PS_ENV_MAN_STANDBOOK
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_GAS_POINTLIST')
            and   type = 'U')
   drop table T_PS_GAS_POINTLIST
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_GAS_POLLUTE_COUNT')
            and   type = 'U')
   drop table T_PS_GAS_POLLUTE_COUNT
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_GAS_POLLUTE_LIMIT')
            and   type = 'U')
   drop table T_PS_GAS_POLLUTE_LIMIT
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
            and   type = 'U')
   drop table T_PS_GAS_POLLUTE_LIMIT_INORG
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
            and   type = 'U')
   drop table T_PS_GAS_POLLUTE_LIMIT_SPECIAL
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
            and   type = 'U')
   drop table T_PS_GAS_PRODUCT_POLL_INFO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_LICENSE_MODIFY')
            and   type = 'U')
   drop table T_PS_LICENSE_MODIFY
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_MANUAL_TESTEQUIP')
            and   type = 'U')
   drop table T_PS_MANUAL_TESTEQUIP
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_SVG_PRODUCT_EQUIP')
            and   type = 'U')
   drop table T_PS_SVG_PRODUCT_EQUIP
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
            and   type = 'U')
   drop table T_PS_SVG_PRODUCT_EQUIP_PARAM
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_WAT_DPOINTLIST')
            and   type = 'U')
   drop table T_PS_WAT_DPOINTLIST
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_WAT_IDPOINTLIST')
            and   type = 'U')
   drop table T_PS_WAT_IDPOINTLIST
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_WAT_POLLUTE_COUNT')
            and   type = 'U')
   drop table T_PS_WAT_POLLUTE_COUNT
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_WAT_POLLUTE_LIMIT')
            and   type = 'U')
   drop table T_PS_WAT_POLLUTE_LIMIT
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
            and   type = 'U')
   drop table T_PS_WAT_POLLUTE_LIMIT_SPECIAL
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
            and   type = 'U')
   drop table T_PS_WAT_PRODUCT_POLL_INFO
go

/*==============================================================*/
/* Table: T_BAS_ENV_STANDARD                                    */
/*==============================================================*/
create table T_BAS_ENV_STANDARD (
   SID                  int                  not null,
   KEYWORD              varchar(100)         null,
   STANDARDNO           varchar(50)          null,
   STANDARDTYPE         varchar(50)          null,
   STANDARDNAME         varchar(100)         not null,
   ENGLISHNAME          varchar(100)         null,
   RELEASEDATE          datetime             null,
   MATERIALDATE         datetime             null,
   SERVERFILENAME       varchar(50)          not null,
   FILEPATH             varchar(250)         not null,
   FILESIZE             numeric              null,
   EXTNAME              varchar(20)          null,
   FTYPE                int                  null,
   CTIME                datetime             null,
   CUSERID              int                  null,
   UPLOADTIME           datetime             null,
   UPUSERID             int                  null,
   ABSTRACT             varchar(500)         null,
   REMARK               varchar(200)         null,
   OLDFILENAME          varchar(100)         not null,
   PUBLISH_UNIT         varchar(200)         null,
   OBSOLETE_DATE        datetime             null,
   constraint PK_T_BAS_ENV_STANDARD primary key nonclustered (SID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_BAS_ENV_STANDARD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰噯閿熻姤鑼�', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'SID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯id',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'SID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'KEYWORD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'KEYWORD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸埅纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'KEYWORD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STANDARDNO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'STANDARDNO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'STANDARDNO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STANDARDTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'STANDARDTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹閫氶敓鏂ゆ嫹閿熻纰夋嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'STANDARDTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STANDARDNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'STANDARDNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'STANDARDNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ENGLISHNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'ENGLISHNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鑻遍敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'ENGLISHNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RELEASEDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'RELEASEDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'RELEASEDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MATERIALDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'MATERIALDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '瀹炴柦閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'MATERIALDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SERVERFILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'SERVERFILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍閿熶茎纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'SERVERFILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILEPATH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'FILEPATH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍璺敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'FILEPATH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILESIZE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'FILESIZE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰皬閿熻鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'FILESIZE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EXTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'EXTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰睍閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'EXTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'FTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'FTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'CTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'CTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'CUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'CUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPLOADTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'UPLOADTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'UPLOADTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'UPUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'UPUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ABSTRACT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'ABSTRACT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鎽樿',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'ABSTRACT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OLDFILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'OLDFILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷风ず閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'OLDFILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PUBLISH_UNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'PUBLISH_UNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂綅',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'PUBLISH_UNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_ENV_STANDARD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OBSOLETE_DATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'OBSOLETE_DATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_ENV_STANDARD', 'column', 'OBSOLETE_DATE'
go

/*==============================================================*/
/* Table: T_BAS_LAW                                             */
/*==============================================================*/
create table T_BAS_LAW (
   LAWID                int                  not null,
   KEYWORD              varchar(100)         null,
   LAWNAME              varchar(100)         not null,
   LAWTYPE              varchar(50)          null,
   RELEASEDATE          datetime             null,
   SERVERFILENAME       varchar(50)          not null,
   FILEPATH             varchar(250)         not null,
   FILESIZE             numeric              null,
   EXTNAME              varchar(20)          null,
   FTYPE                int                  null,
   CTIME                datetime             null,
   CUSERID              int                  null,
   UPLOADTIME           datetime             null,
   UPUSERID             int                  null,
   REMARK               varchar(200)         null,
   OLDFILENAME          varchar(100)         not null,
   MATERIALDATE         datetime             null,
   ABSTRACT             varchar(500)         null,
   PUBLISH_UNIT         varchar(200)         null,
   OBSOLETE_DATE        datetime             null,
   constraint PK_T_BAS_LAW primary key nonclustered (LAWID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_BAS_LAW') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_BAS_LAW' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷烽敓缂村嚖鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LAWID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'LAWID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'LAWID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'KEYWORD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'KEYWORD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸埅纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'KEYWORD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LAWNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'LAWNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'LAWNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LAWTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'LAWTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'LAWTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RELEASEDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'RELEASEDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'RELEASEDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SERVERFILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'SERVERFILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍閿熶茎纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'SERVERFILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILEPATH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'FILEPATH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍璺敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'FILEPATH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILESIZE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'FILESIZE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰皬閿熻鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'FILESIZE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EXTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'EXTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰睍閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'EXTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'FTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'FTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'CTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'CTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'CUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'CUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPLOADTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'UPLOADTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'UPLOADTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'UPUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'UPUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OLDFILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'OLDFILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷风ず閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'OLDFILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MATERIALDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'MATERIALDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '瀹炴柦閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'MATERIALDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ABSTRACT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'ABSTRACT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鎽樿',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'ABSTRACT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PUBLISH_UNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'PUBLISH_UNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂綅',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'PUBLISH_UNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_LAW')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OBSOLETE_DATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'OBSOLETE_DATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_LAW', 'column', 'OBSOLETE_DATE'
go

/*==============================================================*/
/* Table: T_BAS_NEWS                                            */
/*==============================================================*/
create table T_BAS_NEWS (
   NEWSID               int                  not null,
   NEWSTITLE            varchar(100)         null,
   KEYWORD              varchar(100)         null,
   CONTENT              text                 null,
   PUBLISHDATE          datetime             null,
   NEWSSOURCE           varchar(50)          null,
   AUTHOR               varchar(30)          null,
   CTR                  int                  null,
   NEWSTYPEID           int                  null,
   COMMENTTIMES         int                  null,
   CTIME                datetime             null,
   CUSERID              int                  null,
   UPLOADTIME           datetime             null,
   UPUSERID             int                  null,
   REMARK               varchar(200)         null,
   constraint PK_T_BAS_NEWS primary key nonclustered (NEWSID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_BAS_NEWS') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_BAS_NEWS' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NEWSID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NEWSTITLE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSTITLE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSTITLE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'KEYWORD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'KEYWORD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸埅纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'KEYWORD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONTENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CONTENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CONTENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PUBLISHDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'PUBLISHDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'PUBLISHDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NEWSSOURCE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSSOURCE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋簮',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSSOURCE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AUTHOR')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'AUTHOR'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'AUTHOR'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CTR')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CTR'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CTR'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NEWSTYPEID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSTYPEID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'NEWSTYPEID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COMMENTTIMES')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'COMMENTTIMES'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓妗旇揪鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'COMMENTTIMES'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'CUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPLOADTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'UPLOADTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'UPLOADTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'UPUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'UPUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWS')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_BAS_NEWS', 'column', 'REMARK'
go

/*==============================================================*/
/* Table: T_BAS_NEWSCOMMENT                                     */
/*==============================================================*/
create table T_BAS_NEWSCOMMENT (
   COMMENTID            int                  not null,
   NEWSID               int                  null,
   CONTENT              varchar(2000)        null,
   COMMENTDATE          datetime             null,
   COMMENTIP            varchar(20)          null,
   USERID               int                  null,
   constraint PK_T_BAS_NEWSCOMMENT primary key nonclustered (COMMENTID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_BAS_NEWSCOMMENT') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓妗旀唻鎷�', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSCOMMENT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COMMENTID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'COMMENTID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'COMMENTID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSCOMMENT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NEWSID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'NEWSID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'NEWSID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSCOMMENT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONTENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'CONTENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'CONTENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSCOMMENT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COMMENTDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'COMMENTDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'COMMENTDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSCOMMENT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COMMENTIP')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'COMMENTIP'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹ip',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'COMMENTIP'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSCOMMENT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'USERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'USERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺煫浼欐嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSCOMMENT', 'column', 'USERID'
go

/*==============================================================*/
/* Table: T_BAS_NEWSTYPE                                        */
/*==============================================================*/
create table T_BAS_NEWSTYPE (
   NEWSTYPEID           int                  not null,
   TYPENAME             varchar(100)         null,
   PARENTID             int                  null,
   TYPELEVEL            int                  null,
   REMARK               varchar(200)         null,
   constraint PK_T_BAS_NEWSTYPE primary key nonclustered (NEWSTYPEID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_BAS_NEWSTYPE') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NEWSTYPEID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'NEWSTYPEID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'NEWSTYPEID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TYPENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'TYPENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'TYPENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PARENTID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'PARENTID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'PARENTID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TYPELEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'TYPELEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓閰靛眰绾�',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'TYPELEVEL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_NEWSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_BAS_NEWSTYPE', 'column', 'REMARK'
go

/*==============================================================*/
/* Table: T_BAS_RULSINFO                                        */
/*==============================================================*/
create table T_BAS_RULSINFO (
   PID                  int                  not null,
   KEYWORD              varchar(100)         null,
   LAWNAME              varchar(100)         not null,
   RELEASEDATE          datetime             null,
   RTYPE                varchar(50)          null,
   TYPE                 varchar(50)          null,
   SERVERFILENAME       varchar(50)          not null,
   FILEPATH             varchar(250)         not null,
   FILESIZE             numeric              null,
   EXTNAME              varchar(20)          null,
   FTYPE                int                  null,
   CTIME                datetime             null,
   CUSERID              int                  null,
   UPLOADTIME           datetime             null,
   UPUSERID             int                  null,
   REMARK               varchar(200)         null,
   OLDFILENAME          varchar(100)         not null,
   MATERIALDATE         datetime             null,
   ABSTRACT             varchar(500)         null,
   PUBLISH_UNIT         varchar(200)         null,
   OBSOLETE_DATE        datetime             null,
   constraint PK_T_BAS_RULSINFO primary key nonclustered (PID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_BAS_RULSINFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鍓挎唻鎷峰噯閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓渚ュ姙娉曢敓鑺ュ畾缁嗛敓鏂ゆ嫹濞差澁鎷疯瘱閿燂拷', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'PID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'PID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'KEYWORD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'KEYWORD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸埅纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'KEYWORD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LAWNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'LAWNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'LAWNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RELEASEDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'RELEASEDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'RELEASEDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'RTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹1閿熷眾娉�2閿熻姤瀹�3缁嗛敓鏂ゆ嫹4閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'RTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'TYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'TYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SERVERFILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'SERVERFILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍閿熶茎纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'SERVERFILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILEPATH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'FILEPATH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍璺敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'FILEPATH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILESIZE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'FILESIZE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰皬閿熻鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'FILESIZE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EXTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'EXTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰睍閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'EXTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'FTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'FTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'CTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'CTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'CUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'CUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPLOADTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'UPLOADTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'UPLOADTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'UPUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'UPUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OLDFILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'OLDFILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷风ず閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'OLDFILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MATERIALDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'MATERIALDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '瀹炴柦閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'MATERIALDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ABSTRACT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'ABSTRACT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鎽樿',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'ABSTRACT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PUBLISH_UNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'PUBLISH_UNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂綅',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'PUBLISH_UNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_RULSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OBSOLETE_DATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'OBSOLETE_DATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_BAS_RULSINFO', 'column', 'OBSOLETE_DATE'
go

/*==============================================================*/
/* Table: T_BAS_SINFO                                           */
/*==============================================================*/
create table T_BAS_SINFO (
   DATASOURCE_CODE      int                  not null,
   SNAME                varchar(50)          null,
   constraint PK_T_BAS_SINFO primary key nonclustered (DATASOURCE_CODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_BAS_SINFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_BAS_SINFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷峰綍閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓渚ョ殑璇ф嫹鍚岄敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹婧�', 
   'user', @CurrentUser, 'table', 'T_BAS_SINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_SINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATASOURCE_CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_SINFO', 'column', 'DATASOURCE_CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹婧恑d',
   'user', @CurrentUser, 'table', 'T_BAS_SINFO', 'column', 'DATASOURCE_CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_BAS_SINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_BAS_SINFO', 'column', 'SNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹婧愰敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_BAS_SINFO', 'column', 'SNAME'
go

/*==============================================================*/
/* Table: T_DIC_AREACODE                                        */
/*==============================================================*/
create table T_DIC_AREACODE (
   CODE_REGION          varchar(50)          not null,
   REGIONNAME           varchar(50)          null,
   PCODE                varchar(50)          null,
   TYPECODE             varchar(50)          null,
   TYPENAME             varchar(50)          null,
   ORDERNUM             int                  null,
   LONGITUDE            numeric              null,
   LATITUDE             numeric              null,
   LEVEL                int                  null,
   constraint PK_T_DIC_AREACODE primary key nonclustered (CODE_REGION)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_DIC_AREACODE') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熻纰夋嫹-閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE_REGION')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'CODE_REGION'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'CODE_REGION'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REGIONNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'REGIONNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'REGIONNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'PCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'PCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TYPECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'TYPECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'TYPECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TYPENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'TYPENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'TYPENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ORDERNUM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'ORDERNUM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '椤洪敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'ORDERNUM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'LONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'LONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'LATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绾敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'LATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_AREACODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'LEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熷绾�1鐪侀敓鏂ゆ嫹2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_AREACODE', 'column', 'LEVEL'
go

/*==============================================================*/
/* Table: T_DIC_GENCATETYPE                                     */
/*==============================================================*/
create table T_DIC_GENCATETYPE (
   CATEGORYCLASS        varchar(50)          not null,
   CATEGORYNAME         varchar(50)          null,
   constraint PK_T_DIC_GENCATETYPE primary key nonclustered (CATEGORYCLASS)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_DIC_GENCATETYPE') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_DIC_GENCATETYPE' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熻纰夋嫹-閫氶敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍊奸敓鏂ゆ嫹閿熸枻鎷锋崊閿燂拷', 
   'user', @CurrentUser, 'table', 'T_DIC_GENCATETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENCATETYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CATEGORYCLASS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENCATETYPE', 'column', 'CATEGORYCLASS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_GENCATETYPE', 'column', 'CATEGORYCLASS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENCATETYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CATEGORYNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENCATETYPE', 'column', 'CATEGORYNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_GENCATETYPE', 'column', 'CATEGORYNAME'
go

/*==============================================================*/
/* Table: T_DIC_GENERALCATEGORY                                 */
/*==============================================================*/
create table T_DIC_GENERALCATEGORY (
   GENERALCODE          varchar(50)          not null,
   CATEGORYNAME         varchar(500)         null,
   CATEGORYCLASS        varchar(50)          null,
   ORDERNUM             int                  null,
   CSTATUS              int                  null,
   REMARK               varchar(50)          null,
   constraint PK_T_DIC_GENERALCATEGORY primary key nonclustered (GENERALCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_DIC_GENERALCATEGORY') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閫氶敓鏂ゆ嫹閿熻纰夋嫹閿熸枻鎷烽敓鎹凤綇鎷烽敓鏂ゆ嫹浣嶉敓鏂ゆ嫹閿熻銆佹按閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂笟閿熸枻鎷锋ā閿熸枻鎷烽敓鏂ゆ嫹涓氶敓瑙掔》鎷锋敞閿熸枻鎷烽敓鏂ゆ嫹閿熼叺锝忔嫹鐕冮敓绉稿嚖鎷峰紡閿熸枻鎷烽敓鏂ゆ嫹姘撮敓鑴氬嚖鎷峰幓閿熸触锛屽嚖鎷烽敓鏂ゆ嫹閿熻剼鏀剧櫢鎷烽敓缂达綇鎷烽敓鏂ゆ嫹閿熺嫛纭锋嫹閿熸枻鎷�', 
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENERALCATEGORY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GENERALCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'GENERALCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閫氶敓鐭揪鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'GENERALCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENERALCATEGORY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CATEGORYNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'CATEGORYNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'CATEGORYNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENERALCATEGORY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CATEGORYCLASS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'CATEGORYCLASS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'CATEGORYCLASS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENERALCATEGORY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ORDERNUM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'ORDERNUM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'ORDERNUM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENERALCATEGORY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CSTATUS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'CSTATUS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐘舵��,1閿熸枻鎷烽敓鏂ゆ嫹0鍋滈敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'CSTATUS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_GENERALCATEGORY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_DIC_GENERALCATEGORY', 'column', 'REMARK'
go

/*==============================================================*/
/* Table: T_DIC_POINTSYSTYPE                                    */
/*==============================================================*/
create table T_DIC_POINTSYSTYPE (
   SYSTEMTYPE           int                  not null,
   SYSNAME              varchar(50)          null,
   TNAMERT              varchar(30)          null,
   TNAMEMI              varchar(30)          null,
   TNAMEHH              varchar(30)          null,
   REMARK               varchar(50)          null,
   SNAME                varchar(30)          null,
   PNAME                varchar(30)          null,
   ATNAMERT             varchar(30)          null,
   ATNAMEMI             varchar(30)          null,
   ATNAMEHH             varchar(30)          null,
   C1                   varchar(30)          null,
   C2                   varchar(30)          null,
   TNAMESTAT            varchar(30)          null,
   C3                   varchar(30)          null,
   VALIDTIMEMI          varchar(30)          null,
   constraint PK_T_DIC_POINTSYSTYPE primary key nonclustered (SYSTEMTYPE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_DIC_POINTSYSTYPE') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熻纰夋嫹-閿熸枻鎷烽敓杈冧綆绛规嫹閿熸枻鎷烽敓锟�', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SYSTEMTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'SYSTEMTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绯荤粺閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'SYSTEMTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SYSNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'SYSNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绯荤粺閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'SYSNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TNAMERT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMERT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '瀹炴椂閿熸枻鎷烽敓鎹锋唻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMERT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TNAMEMI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMEMI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鎹锋唻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMEMI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TNAMEHH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMEHH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '灏忔椂閿熸枻鎷烽敓鎹锋唻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMEHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'SNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风珯-閿熸枻鎷锋煋婧愰敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'SNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'PNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓锟�-閿熻剼鍖℃嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'PNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ATNAMERT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'ATNAMERT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '瀹炴椂閿熸枻鎷烽敓鎹锋唻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'ATNAMERT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ATNAMEMI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'ATNAMEMI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鎹锋唻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'ATNAMEMI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ATNAMEHH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'ATNAMEHH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '灏忔椂閿熸枻鎷烽敓鎹锋唻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'ATNAMEHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'C1')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'C1'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰睍閿熸枻鎷�1',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'C1'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'C2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'C2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰睍閿熸枻鎷�2',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'C2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TNAMESTAT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMESTAT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '缁熼敓鐙℃唻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'TNAMESTAT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'C3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'C3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰睍閿熸枻鎷�3',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'C3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_POINTSYSTYPE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'VALIDTIMEMI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'VALIDTIMEMI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋晥鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_POINTSYSTYPE', 'column', 'VALIDTIMEMI'
go

/*==============================================================*/
/* Table: T_DIC_STDPOLLCODE                                     */
/*==============================================================*/
create table T_DIC_STDPOLLCODE (
   POLLUTECODE          varchar(50)          not null,
   SYSTEMTYPE           int                  not null,
   SYMBOLS              varchar(50)          null,
   POLLUTENAME          varchar(50)          null,
   ENNAME               varchar(50)          null,
   CODETYPE             varchar(50)          null,
   POLLCONCUNIT         varchar(50)          null,
   POLLUTEAMOUNTUNIT    varchar(50)          null,
   NUMPRECISION         int                  null,
   CAS                  varchar(20)          null,
   POLLUTEALIAS         varchar(50)          null,
   ORDERNUM             int                  null,
   CODECLASS            varchar(50)          null,
   ISAUDIT              int                  null,
   POLLUTECLASS         varchar(20)          null,
   constraint PK_T_DIC_STDPOLLCODE primary key nonclustered (POLLUTECODE, SYSTEMTYPE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_DIC_STDPOLLCODE') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熻纰夋嫹-閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷风洰閿熸枻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SYSTEMTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'SYSTEMTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绯荤粺閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'SYSTEMTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SYMBOLS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'SYMBOLS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'SYMBOLS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ENNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'ENNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷疯嫳閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'ENNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'CODETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风洰閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'CODETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLCONCUNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLCONCUNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷锋祿閿熼ズ纰夋嫹浣�',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLCONCUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTEAMOUNTUNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTEAMOUNTUNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷烽敓鏂ゆ嫹閿熸枻鎷蜂綅',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTEAMOUNTUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NUMPRECISION')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'NUMPRECISION'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'NUMPRECISION'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CAS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'CAS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CAS閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'CAS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTEALIAS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTEALIAS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTEALIAS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ORDERNUM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'ORDERNUM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'ORDERNUM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODECLASS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'CODECLASS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风洰閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'CODECLASS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISAUDIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'ISAUDIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷疯閿熷壙鐧告嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'ISAUDIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_STDPOLLCODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECLASS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTECLASS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_STDPOLLCODE', 'column', 'POLLUTECLASS'
go

/*==============================================================*/
/* Table: T_DIC_TRADECODE                                       */
/*==============================================================*/
create table T_DIC_TRADECODE (
   CODE_TRADE           varchar(50)          not null,
   TRADENAME            varchar(200)         null,
   PCODE                varchar(50)          null,
   INSTRUCTIONS         varchar(500)         null,
   constraint PK_T_DIC_TRADECODE primary key nonclustered (CODE_TRADE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_DIC_TRADECODE') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熻纰夋嫹-閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_TRADECODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE_TRADE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'CODE_TRADE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'CODE_TRADE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_TRADECODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TRADENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'TRADENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'TRADENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_TRADECODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'PCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'PCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_TRADECODE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'INSTRUCTIONS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'INSTRUCTIONS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '璇撮敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_DIC_TRADECODE', 'column', 'INSTRUCTIONS'
go

/*==============================================================*/
/* Table: T_DIC_WSYSTEMRIVER                                    */
/*==============================================================*/
create table T_DIC_WSYSTEMRIVER (
   CODE_WSYSTEMWATER    varchar(10)          not null,
   WSYSTEMWATERNAME     varchar(200)         null,
   DATATYPE             int                  null,
   PCODE                varchar(10)          null,
   constraint PK_T_DIC_WSYSTEMRIVER primary key nonclustered (CODE_WSYSTEMWATER)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_DIC_WSYSTEMRIVER') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熻纰夋嫹-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�', 
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_WSYSTEMRIVER')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE_WSYSTEMWATER')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'CODE_WSYSTEMWATER'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'CODE_WSYSTEMWATER'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_WSYSTEMRIVER')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WSYSTEMWATERNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'WSYSTEMWATERNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'WSYSTEMWATERNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_WSYSTEMRIVER')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'DATATYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹1閿熸枻鎷烽敓鏂ゆ嫹2閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'DATATYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_DIC_WSYSTEMRIVER')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'PCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹ID',
   'user', @CurrentUser, 'table', 'T_DIC_WSYSTEMRIVER', 'column', 'PCODE'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_AREAAQIDD                              */
/*==============================================================*/
create table T_ENV_MONI_AIR_AREAAQIDD (
   CODE                 varchar(50)          not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 numeric              null,
   PM10                 numeric              null,
   PM10IAQI             int                  null,
   SO2                  numeric              null,
   SO2IAQI              int                  null,
   NO2                  numeric              null,
   NO2IAQI              int                  null,
   CO                   numeric              null,
   COIAQI               int                  null,
   O3                   numeric              null,
   O3IAQI               int                  null,
   O38                  numeric              null,
   O38IAQI              int                  null,
   POLLUTENAME          varchar(50)          null,
   AQIID                int                  null,
   UPDATETIME           datetime             null,
   LEVEL                int                  null,
   constraint PK_T_ENV_MONI_AIR_AREAAQIDD primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熸枻鎷稟QI閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQIID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'AQIID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'AQIID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'LEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '0閿熸枻鎷烽敓鏂ゆ嫹1鐪侀敓鏂ゆ嫹 2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷烽敓鏂ゆ嫹4閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIDD', 'column', 'LEVEL'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_AREAAQIHH                              */
/*==============================================================*/
create table T_ENV_MONI_AIR_AREAAQIHH (
   CODE                 varchar(50)          not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 numeric              null,
   PM10                 numeric              null,
   PM10IAQI             int                  null,
   SO2                  numeric              null,
   SO2IAQI              int                  null,
   NO2                  numeric              null,
   NO2IAQI              int                  null,
   CO                   numeric              null,
   COIAQI               int                  null,
   O3                   numeric              null,
   O3IAQI               int                  null,
   O38                  numeric              null,
   O38IAQI              int                  null,
   AVGVALUE_PM25        int                  null,
   AVGVALUE_PM10        int                  null,
   POLLUTENAME          varchar(50)          null,
   AQIID                int                  null,
   UPDATETIME           datetime             null,
   LEVEL                int                  null,
   constraint PK_T_ENV_MONI_AIR_AREAAQIHH primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋仾顫嫹閿熸枻鎷烽敓绱窺I閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍏�閿熸枻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AVGVALUE_PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AVGVALUE_PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AVGVALUE_PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AVGVALUE_PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQIID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AQIID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'AQIID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AREAAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'LEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '0閿熸枻鎷烽敓鏂ゆ嫹1鐪侀敓鏂ゆ嫹 2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AREAAQIHH', 'column', 'LEVEL'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_DATADD                                 */
/*==============================================================*/
create table T_ENV_MONI_AIR_DATADD (
   POINTCODE            int                  not null,
   POLLUTECODE          varchar(50)          not null,
   DATATIME             datetime             not null,
   MAXVALUE             numeric              null,
   MINVALUE             numeric              null,
   DATAVALUE            numeric              null,
   AUDITVALUE           numeric              null,
   DATASTATUS           char(1)              null,
   ISVALIDED            smallint             null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50)          null,
   constraint PK_T_ENV_MONI_AIR_DATADD primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_DATADD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AUDITVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'AUDITVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'AUDITVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATASTATUS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATASTATUS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鐘舵��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATASTATUS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISVALIDED')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'ISVALIDED'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷锋晥',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'ISVALIDED'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐘舵�侀敓鏂ゆ嫹璇�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAFLAG'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_DATAHH                                 */
/*==============================================================*/
create table T_ENV_MONI_AIR_DATAHH (
   POINTCODE            int                  not null,
   POLLUTECODE          varchar(50)          not null,
   DATATIME             datetime             not null,
   MAXVALUE             numeric              null,
   MINVALUE             numeric              null,
   DATAVALUE            numeric              null,
   AUDITVALUE           numeric              null,
   DATASTATUS           char(1)              null,
   ISVALIDED            smallint             null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50)          null,
   constraint PK_T_ENV_MONI_AIR_DATAHH primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_DATAHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熷彨鈭堟唻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AUDITVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'AUDITVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'AUDITVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATASTATUS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATASTATUS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鐘舵��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATASTATUS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISVALIDED')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'ISVALIDED'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷锋晥',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'ISVALIDED'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐘舵�侀敓鏂ゆ嫹璇�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAFLAG'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_POINTAQIDD                             */
/*==============================================================*/
create table T_ENV_MONI_AIR_POINTAQIDD (
   CODE                 varchar(50)          not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 numeric              null,
   PM10                 numeric              null,
   PM10IAQI             int                  null,
   SO2                  numeric              null,
   SO2IAQI              int                  null,
   NO2                  numeric              null,
   NO2IAQI              int                  null,
   CO                   numeric              null,
   COIAQI               int                  null,
   O3                   numeric              null,
   O3IAQI               int                  null,
   O38                  numeric              null,
   O38IAQI              int                  null,
   POLLUTENAME          varchar(50)          null,
   AQIID                int                  null,
   UPDATETIME           datetime             null,
   constraint PK_T_ENV_MONI_AIR_POINTAQIDD primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熺锤QI閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQIID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'AQIID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'AQIID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIDD', 'column', 'UPDATETIME'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_POINTAQIHH                             */
/*==============================================================*/
create table T_ENV_MONI_AIR_POINTAQIHH (
   CODE                 varchar(50)          not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 numeric              null,
   PM10                 numeric              null,
   PM10IAQI             int                  null,
   SO2                  numeric              null,
   SO2IAQI              int                  null,
   NO2                  numeric              null,
   NO2IAQI              int                  null,
   CO                   numeric              null,
   COIAQI               int                  null,
   O3                   numeric              null,
   O3IAQI               int                  null,
   O38                  numeric              null,
   O38IAQI              int                  null,
   AVGVALUE_PM25        int                  null,
   AVGVALUE_PM10        int                  null,
   POLLUTENAME          varchar(50)          null,
   AQIID                int                  null,
   UPDATETIME           datetime             null,
   constraint PK_T_ENV_MONI_AIR_POINTAQIHH primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熺锤QI鏃堕敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AVGVALUE_PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AVGVALUE_PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AVGVALUE_PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AVGVALUE_PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQIID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AQIID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'AQIID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_POINTAQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_POINTAQIHH', 'column', 'UPDATETIME'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_STATION                                */
/*==============================================================*/
create table T_ENV_MONI_AIR_STATION (
   POINTCODE            int                  not null,
   STATIONCODE          int                  null,
   STDPOINTCODE         varchar(50)          null,
   POINTNAME            varchar(100)         null,
   POINTADDRESS         varchar(50)          null,
   GASAREACODE          varchar(50)          null,
   ATRRIBUTECODE        varchar(50)          null,
   REGIONCODE           varchar(50)          null,
   REPORTLEVELCODE      varchar(50)          null,
   AIRLEVELCODE         varchar(50)          null,
   PRECIPITATIONLEVELCODE varchar(50)          null,
   SO2LEVELCODE         varchar(50)          null,
   ACIDLEVELCODE        varchar(50)          null,
   LONGITUDE            numeric              null,
   LATITUDE             numeric              null,
   HEIGHT               numeric              null,
   POINTCODETYPE        int                  null,
   CREATETIME           datetime             null,
   ORDERNUM             int                  null,
   MICYCLETIME          int                  null,
   RTCYCLETIME          int                  null,
   ISSUPPLEMENT         int                  null,
   STATIONTYPE          int                  null,
   STATUS               int                  null,
   SCODE                int                  null,
   HASVIDEO             int                  null,
   CONTROLLEVEL         varchar(50)          null,
   BUILDDEPT            varchar(100)         null,
   COMMUNICATION        varchar(50)          null,
   CARDNUMBER           varchar(100)         null,
   IPGP                 varchar(100)         null,
   PICCODELIST          varchar(100)         null,
   POINTFIRSTLETTER     varchar(100)         null,
   LINKMAN              varchar(50)          null,
   OFFICEPHONE          varchar(50)          null,
   DESCRIPTION          varchar(100)         null,
   ISRQC                int                  null,
   ISTIMECAL            int                  null,
   ISMSGACK             int                  null,
   ISSUP212             int                  null,
   ISVERIFYPASSWD       int                  null,
   ISSTATSMI            int                  null,
   ISSTATSHH            int                  null,
   ISTATSDD             int                  null,
   SYSTEMTYPE           int                  null,
   DATASOURCE_CODE      int                  null,
   constraint PK_T_ENV_MONI_AIR_STATION primary key nonclustered (POINTCODE),
   constraint AK_UK_T_ENV_MONI_AIR__T_ENV_MO unique (STDPOINTCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_STATION') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熻緝锟�', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STATIONCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STATIONCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风珯閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STATIONCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STDPOINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STDPOINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STDPOINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTADDRESS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTADDRESS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓杞夸紮鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTADDRESS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GASAREACODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'GASAREACODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'GASAREACODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ATRRIBUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ATRRIBUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熺殕杈炬嫹閿熸枻鎷�(閿熸枻鎷蜂綅閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鐙＄鎷�,閿熸枻鎷烽敓鍙唻鎷烽敓鏂ゆ嫹閿熸枻鎷�,閿熸枻鎷烽敓鐙＄鎷�)',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ATRRIBUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REGIONCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'REGIONCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'REGIONCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REPORTLEVELCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'REPORTLEVELCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ョ骇閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'REPORTLEVELCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AIRLEVELCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'AIRLEVELCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏉扮》鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'AIRLEVELCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRECIPITATIONLEVELCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'PRECIPITATIONLEVELCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熸枻鎷烽敓鏉扮》鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'PRECIPITATIONLEVELCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2LEVELCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'SO2LEVELCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏉扮》鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'SO2LEVELCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ACIDLEVELCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ACIDLEVELCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏉扮》鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ACIDLEVELCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'LONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'LONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'LATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绾敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'LATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'HEIGHT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'HEIGHT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熺璁规嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'HEIGHT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTCODETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�1閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷锋按閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTCODETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CREATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'CREATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'CREATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ORDERNUM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ORDERNUM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ORDERNUM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MICYCLETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'MICYCLETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熻緝鎲嬫嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'MICYCLETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RTCYCLETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'RTCYCLETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '瀹炴椂閿熸枻鎷烽敓鏂ゆ嫹閿熻緝鎲嬫嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'RTCYCLETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISSUPPLEMENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSUPPLEMENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹鏀敓琛楄鎷烽敓鏂ゆ嫹1閿熸枻鎷�0閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSUPPLEMENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STATIONTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STATIONTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风珯閿熸枻鎷烽敓鏂ゆ嫹1閿熸枻鎷疯惀閿熸枻鎷烽敓锟�2鎶撳彇閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STATIONTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STATUS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STATUS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐘舵��,-1鍒犻敓鏂ゆ嫹1閿熸枻鎷烽敓鏂ゆ嫹0閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'STATUS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'SCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鎵ч敓鍙唻鎷峰噯',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'SCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'HASVIDEO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'HASVIDEO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熸枻鎷烽敓鐙＄鎷烽敓锟�0閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽閿熸枻鎷�1閿熸枻鎷烽敓鏂ゆ嫹棰戦敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'HASVIDEO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONTROLLEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'CONTROLLEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鐙＄》鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'CONTROLLEVEL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'BUILDDEPT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'BUILDDEPT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鍊熷崟浣�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'BUILDDEPT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COMMUNICATION')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'COMMUNICATION'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閫氳閿熸枻鎷峰紡',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'COMMUNICATION'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CARDNUMBER')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'CARDNUMBER'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'IP/SIM閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'CARDNUMBER'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'IPGP')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'IPGP'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'IPGP'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PICCODELIST')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'PICCODELIST'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓閰佃鐞瞕閿熸枻鎷烽敓鏂ゆ嫹閿熻剼鍒嗛潻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'PICCODELIST'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTFIRSTLETTER')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTFIRSTLETTER'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓渚ラ潻鎷烽敓鍙拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'POINTFIRSTLETTER'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LINKMAN')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'LINKMAN'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风郴閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'LINKMAN'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OFFICEPHONE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'OFFICEPHONE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风郴閿熺晫璇�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'OFFICEPHONE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DESCRIPTION')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'DESCRIPTION'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'DESCRIPTION'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISRQC')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISRQC'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�,1閿熸枻鎷�0閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISRQC'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISTIMECAL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISTIMECAL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷烽敓缁炴唻鎷烽敓鍙挤锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISTIMECAL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISMSGACK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISMSGACK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熻緝鈷傦讣鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISMSGACK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISSUP212')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSUP212'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹鏀敓鏂ゆ嫹T212鍗忛敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSUP212'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISVERIFYPASSWD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISVERIFYPASSWD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熻鍑ゆ嫹閿熸枻鎷疯閿熸枻鎷疯瘉閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISVERIFYPASSWD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISSTATSMI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSTATSMI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹缁熼敓鐙″嚖鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSTATSMI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISSTATSHH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSTATSHH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹缁熼敓鏂ゆ嫹灏忔椂閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISSTATSHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISTATSDD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISTATSDD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹缁熼敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'ISTATSDD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SYSTEMTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'SYSTEMTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绯荤粺閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'SYSTEMTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATASOURCE_CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'DATASOURCE_CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋簮閿熸枻鎷疯瘑',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_STATION', 'column', 'DATASOURCE_CODE'
go

/*==============================================================*/
/* Table: T_ENV_MONI_SAIR_DATADD                                */
/*==============================================================*/
create table T_ENV_MONI_SAIR_DATADD (
   POINTCODE            int                  not null,
   POLLUTECODE          varchar(50)          not null,
   DATATIME             datetime             not null,
   MAXVALUE             numeric              null,
   MINVALUE             numeric              null,
   DATAVALUE            numeric              null,
   AUDITVALUE           numeric              null,
   DATASTATUS           char(1)              null,
   ISVALIDED            smallint             null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50)          null,
   constraint PK_T_ENV_MONI_SAIR_DATADD primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_SAIR_DATADD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AUDITVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'AUDITVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'AUDITVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATASTATUS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATASTATUS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鐘舵��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATASTATUS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISVALIDED')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'ISVALIDED'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷锋晥',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'ISVALIDED'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐘舵�侀敓鏂ゆ嫹璇�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATADD', 'column', 'DATAFLAG'
go

/*==============================================================*/
/* Table: T_ENV_MONI_SAIR_DATAHH                                */
/*==============================================================*/
create table T_ENV_MONI_SAIR_DATAHH (
   POINTCODE            int                  not null,
   POLLUTECODE          varchar(50)          not null,
   DATATIME             datetime             not null,
   MAXVALUE             numeric              null,
   MINVALUE             numeric              null,
   DATAVALUE            numeric              null,
   AUDITVALUE           numeric              null,
   DATASTATUS           char(1)              null,
   ISVALIDED            smallint             null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50)          null,
   constraint PK_T_ENV_MONI_SAIR_DATAHH primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_SAIR_DATAHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹绔欓敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熷彨鈭堟唻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AUDITVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'AUDITVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'AUDITVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATASTATUS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATASTATUS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鐘舵��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATASTATUS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISVALIDED')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'ISVALIDED'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹閿熸枻鎷锋晥',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'ISVALIDED'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_SAIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐘舵�侀敓鏂ゆ嫹璇�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_SAIR_DATAHH', 'column', 'DATAFLAG'
go

/*==============================================================*/
/* Table: T_ENV_MONI_STATION                                    */
/*==============================================================*/
create table T_ENV_MONI_STATION (
   STATIONCODE          int                  identity,
   STATIONMN            varchar(50)          null,
   STATIONNAME          varchar(50)          null,
   CONTROLLEVEL         varchar(50)          null,
   REGIONRANGETYPE      int                  null,
   REGIONCODE           varchar(50)          null,
   AIRSTANDARDCODE      varchar(50)          null,
   DUSTSTANDARDCODE     varchar(50)          null,
   WATERSTANDARDCODE    varchar(50)          null,
   NOISELEVELCODE       varchar(50)          null,
   LONGITUDE            numeric              null,
   LATITUDE             numeric              null,
   HEIGHT               numeric              null,
   STATIONTYPE          int                  null,
   MONITORTYPE          varchar(50)          null,
   ISSUPPLEMENT         int                  null,
   VALIDTIME            datetime             null,
   INVALIDTIME          datetime             null,
   ORDERNUM             int                  null,
   DATASOURCE_CODE      int                  null,
   constraint PK_T_ENV_MONI_STATION primary key nonclustered (STATIONCODE),
   constraint AK_UK_T_ENV_MONI_STAT_T_ENV_MO unique (STATIONMN)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_STATION') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷风珯閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STATIONCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风珯閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STATIONMN')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONMN'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风珯mn',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONMN'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STATIONNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风珯閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONTROLLEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'CONTROLLEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鐙＄》鎷烽敓鏂ゆ嫹1閿熸枻鎷烽敓鏂ゆ嫹2鐪侀敓鏂ゆ嫹3閿熷彨鍖℃嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'CONTROLLEVEL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REGIONRANGETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'REGIONRANGETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鍥撮敓鏂ゆ嫹閿熸枻鎷�1閿熸枻鎷�2鐪�3閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'REGIONRANGETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REGIONCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'REGIONCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'REGIONCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AIRSTANDARDCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'AIRSTANDARDCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鎵ч敓鍙唻鎷峰噯',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'AIRSTANDARDCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DUSTSTANDARDCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'DUSTSTANDARDCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鎵ч敓鍙唻鎷峰噯',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'DUSTSTANDARDCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WATERSTANDARDCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'WATERSTANDARDCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按鎵ч敓鍙唻鎷峰噯',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'WATERSTANDARDCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NOISELEVELCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'NOISELEVELCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏉扮》鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'NOISELEVELCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'LONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'LONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'LATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绾敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'LATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'HEIGHT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'HEIGHT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熺璁规嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'HEIGHT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STATIONTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风珯閿熸枻鎷烽敓鏂ゆ嫹1閿熸枻鎷疯惀绔欓敓鏂ゆ嫹2鎶撳彇绔欓敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'STATIONTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MONITORTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'MONITORTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'MONITORTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISSUPPLEMENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'ISSUPPLEMENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹鏀敓琛楄鎷烽敓鏂ゆ嫹1閿熸枻鎷�0閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'ISSUPPLEMENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'VALIDTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'VALIDTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋晥鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'VALIDTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'INVALIDTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'INVALIDTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '澶辨晥鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'INVALIDTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ORDERNUM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'ORDERNUM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'ORDERNUM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_STATION')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATASOURCE_CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'DATASOURCE_CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋簮閿熸枻鎷疯瘑',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_STATION', 'column', 'DATASOURCE_CODE'
go

/*==============================================================*/
/* Table: T_PS_BAS_ENTERLIST                                    */
/*==============================================================*/
create table T_PS_BAS_ENTERLIST (
   PSCODE               int                  identity,
   STDPSCODE            varchar(50)          null,
   ENTERNAME            varchar(100)         null,
   IPGP                 varchar(100)         null,
   REGISTER_ADDRESS     varchar(100)         null,
   POSTALCODE           varchar(20)          null,
   ENTERADDRESS         varchar(100)         null,
   CODE_TRADE           varchar(50)          null,
   PRODUCTDATE          datetime             null,
   LONGITUDE            numeric              null,
   LATITUDE             numeric              null,
   ORGANIZATIONCODE     varchar(50)          null,
   CREDITCODE           varchar(50)          null,
   TECHLEADER           varchar(50)          null,
   LINKTEL              varchar(20)          null,
   ISKEYAREA            varchar(20)          null,
   PRIMARY_POLLTYPE     varchar(50)          null,
   WAT_POLLUTES         varchar(300)         null,
   GAS_POLLUTES         varchar(300)         null,
   GAS_EMISSION_FORM    varchar(50)          null,
   WAT_EMISSION_FORM    varchar(50)          null,
   GAS_STANDARD_NAME    varchar(300)         null,
   WAT_STANDARD_NAME    varchar(300)         null,
   CORPNAME             varchar(20)          null,
   TEL                  varchar(20)          null,
   PHONE                varchar(20)          null,
   constraint PK_T_PS_BAS_ENTERLIST primary key nonclustered (PSCODE),
   constraint AK_UK_T_PS_BAS_ENTERL_T_PS_BAS unique (STDPSCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_ENTERLIST') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鎭�', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰簲涔嬪墠閿熸枻鎷穙rgid',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STDPSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'STDPSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'STDPSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ENTERNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ENTERNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂綅閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ENTERNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'IPGP')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'IPGP'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'IPGP'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REGISTER_ADDRESS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'REGISTER_ADDRESS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '娉ㄩ敓鏂ゆ嫹閿熻锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'REGISTER_ADDRESS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POSTALCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'POSTALCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'POSTALCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ENTERADDRESS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ENTERADDRESS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷峰潃',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ENTERADDRESS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE_TRADE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'CODE_TRADE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'CODE_TRADE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRODUCTDATE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PRODUCTDATE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鎶曢敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PRODUCTDATE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'LONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷疯惀閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'LONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'LATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷疯惀閿熸枻鎷烽敓鏂ゆ嫹绾敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'LATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ORGANIZATIONCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ORGANIZATIONCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风粐閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ORGANIZATIONCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CREDITCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'CREDITCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'CREDITCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TECHLEADER')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'TECHLEADER'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'TECHLEADER'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LINKTEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'LINKTEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风郴閿熺晫璇�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'LINKTEL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISKEYAREA')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ISKEYAREA'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鑺傜鎷烽敓瑙掑嚖鎷烽敓鎴鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'ISKEYAREA'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRIMARY_POLLTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PRIMARY_POLLTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷疯閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PRIMARY_POLLTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WAT_POLLUTES')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'WAT_POLLUTES'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熸枻鎷疯閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'WAT_POLLUTES'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GAS_POLLUTES')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'GAS_POLLUTES'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷疯閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'GAS_POLLUTES'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GAS_EMISSION_FORM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'GAS_EMISSION_FORM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷烽敓鏂ゆ嫹寮�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'GAS_EMISSION_FORM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WAT_EMISSION_FORM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'WAT_EMISSION_FORM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氭斁鐧告嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'WAT_EMISSION_FORM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GAS_STANDARD_NAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'GAS_STANDARD_NAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷锋墽閿熷彨鎲嬫嫹鍑嗛敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'GAS_STANDARD_NAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WAT_STANDARD_NAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'WAT_STANDARD_NAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '姘撮敓鏂ゆ嫹鏌撻敓鏂ゆ嫹閿熻剼鍑ゆ嫹鎵ч敓鍙唻鎷峰噯閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'WAT_STANDARD_NAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CORPNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'CORPNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'CORPNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'TEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸暀璁规嫹閿熺晫璇�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'TEL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PHONE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PHONE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熺嫛璁规嫹閿熺晫璇�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERLIST', 'column', 'PHONE'
go

/*==============================================================*/
/* Table: T_PS_BAS_ENTERREMARK                                  */
/*==============================================================*/
create table T_PS_BAS_ENTERREMARK (
   PSCODE               int                  identity,
   GAS_POLL_REMARK      varchar(300)         null,
   WAT_PERMIT_POLL_REMARK varchar(300)         null,
   GAS_PERMIT_POLL_REMARK varchar(300)         null,
   GAS_POUTPUT_REMARK   varchar(300)         null,
   GAS_OUTPUT_REMARK    varchar(300)         null,
   WINTER_POLL_PRE      varchar(500)         null,
   OTHER_EXCEP_CASEINFO varchar(500)         null,
   WAT_POUTPUT_REMARK   varchar(300)         null,
   WAT_OUTPUT_REMARK    varchar(300)         null,
   WAT_EOUTPUT_REMARK   varchar(300)         null,
   constraint PK_T_PS_BAS_ENTERREMARK primary key nonclustered (PSCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_ENTERREMARK') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷�-閿熸枻鎷蜂笟閿熸枻鎷锋敞閿熸枻鎷锋伅', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰簲涔嬪墠閿熸枻鎷穙rgid',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GAS_POLL_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_POLL_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鍏ㄩ敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹缁囬敓鑴氭斁鎲嬫嫹娉ㄩ敓鏂ゆ嫹鎭�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_POLL_REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WAT_PERMIT_POLL_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_PERMIT_POLL_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按鍏ㄩ敓鏂ゆ嫹閿熻剼鍙ｆ唻鎷锋敞閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_PERMIT_POLL_REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GAS_PERMIT_POLL_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_PERMIT_POLL_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熻剼鍑ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熼樁顫嫹閿熻緝锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_PERMIT_POLL_REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GAS_POUTPUT_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_POUTPUT_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷疯閿熻剼鏀惧彛鎲嬫嫹娉ㄩ敓鏂ゆ嫹鎭�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_POUTPUT_REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'GAS_OUTPUT_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_OUTPUT_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹涓�閿熸枻鎷烽敓鑴氭斁鍙ｆ唻鎷锋敞閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'GAS_OUTPUT_REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WINTER_POLL_PRE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WINTER_POLL_PRE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋敞閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WINTER_POLL_PRE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHER_EXCEP_CASEINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'OTHER_EXCEP_CASEINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熼樁顫嫹閿熻緝锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'OTHER_EXCEP_CASEINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WAT_POUTPUT_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_POUTPUT_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熸枻鎷疯閿熻剼鏀惧彛鎲嬫嫹娉ㄩ敓鏂ゆ嫹鎭�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_POUTPUT_REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WAT_OUTPUT_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_OUTPUT_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按涓�閿熸枻鎷烽敓鑴氭斁鍙ｆ唻鎷锋敞閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_OUTPUT_REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_ENTERREMARK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WAT_EOUTPUT_REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_EOUTPUT_REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋柦閿熸触杞︾》鎷烽敓鍓款噯鎷锋瓒磋瘨閿熼樁顫嫹閿熻緝锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_ENTERREMARK', 'column', 'WAT_EOUTPUT_REMARK'
go

/*==============================================================*/
/* Table: T_PS_BAS_FILEINFO                                     */
/*==============================================================*/
create table T_PS_BAS_FILEINFO (
   FILEID               int                  not null,
   PSCODE               int                  identity,
   FILETYPE             varchar(50)          null,
   FILENAME             varchar(50)          null,
   SERVERFILENAME       varchar(50)          null,
   FILEPATH             varchar(255)         null,
   FILESIZE             float                null,
   EXTNAME              varchar(50)          null,
   CTIME                datetime             null,
   CUSERID              int                  null,
   REMARK               varchar(200)         null,
   UPLOADTIME           datetime             null,
   UPUSERID             int                  null,
   constraint PK_T_PS_BAS_FILEINFO primary key nonclustered (FILEID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_FILEINFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍥鹃敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍥鹃敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILEID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILEID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILEID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰簲涔嬪墠閿熸枻鎷穙rgid',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SERVERFILENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'SERVERFILENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍閿熶茎纭锋嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'SERVERFILENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILEPATH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILEPATH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鑺ュ偍璺敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILEPATH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FILESIZE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILESIZE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰皬閿熻鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'FILESIZE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EXTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'EXTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熶茎纭锋嫹閿熸枻鎷峰睍閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'EXTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'CTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'CTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'CUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝杈炬嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'CUSERID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'REMARK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPLOADTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'UPLOADTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'UPLOADTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FILEINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPUSERID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'UPUSERID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺煫浼欐嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FILEINFO', 'column', 'UPUSERID'
go

/*==============================================================*/
/* Table: T_PS_BAS_FUEL                                         */
/*==============================================================*/
create table T_PS_BAS_FUEL (
   FUELID               int                  not null,
   PSCODE               int                  null,
   FUELNAME             varchar(50)          null,
   ASHPERCENT           float                null,
   SULFURPERCENT        float                null,
   VOLATILESPERCENT     float                null,
   MUNIT                float                null,
   MAXUSEVALUE          float                null,
   OTHERINFO            varchar(100)         null,
   constraint PK_T_PS_BAS_FUEL primary key nonclustered (FUELID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_FUEL') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-鐕冮敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FUELID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'FUELID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐕冮敓杈冭揪鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'FUELID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FUELNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'FUELNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鐕冮敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'FUELNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ASHPERCENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'ASHPERCENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸彮鍒嗭綇鎷�%閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'ASHPERCENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SULFURPERCENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'SULFURPERCENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閮戦敓锟�%閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'SULFURPERCENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'VOLATILESPERCENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'VOLATILESPERCENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸帴鍑ゆ嫹閿熻锝忔嫹%閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'VOLATILESPERCENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MUNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'MUNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰�奸敓鏂ゆ嫹MJ/kg,MJ/m3閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'MUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXUSEVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'MAXUSEVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺粸鐧告嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓绲�/a,閿熸枻鎷穖3/a閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'MAXUSEVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_FUEL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_FUEL', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_BAS_LICENCE                                      */
/*==============================================================*/
create table T_PS_BAS_LICENCE (
   LCODE                varchar(50)          not null,
   PSCODE               int                  null,
   DISTIME              datetime             null,
   STIME                datetime             null,
   ETIME                datetime             null,
   CUTTIME              datetime             null,
   LSTATUS              varchar(50)          null,
   ISSUNIT              varchar(50)          null,
   LTYPE                varchar(50)          null,
   AUTHORITY            varchar(50)          null,
   MOTMONTH             int                  null,
   PTYPE                varchar(50)          null,
   APPPERSON            varchar(50)          null,
   APPTIME              datetime             null,
   OPERATOR             varchar(50)          null,
   APPROVETIME          datetime             null,
   REMARK               varchar(200)         null
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_LICENCE') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓琛椼倧鎷烽敓杈冿拷', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'LCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓琛椼倧鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'LCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DISTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'DISTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓琛椼倧鎷烽敓琛椼倧鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'DISTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'STIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'STIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'ETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'ETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CUTTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'CUTTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸埅鎲嬫嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'CUTTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LSTATUS')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'LSTATUS'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '璇侀敓鏂ゆ嫹鐘舵��',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'LSTATUS'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISSUNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'ISSUNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷疯瘉閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'ISSUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'LTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'LTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AUTHORITY')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'AUTHORITY'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏉冮敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'AUTHORITY'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MOTMONTH')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'MOTMONTH'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹璺敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'MOTMONTH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'PTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'PTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'APPPERSON')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'APPPERSON'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'APPPERSON'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'APPTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'APPTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'APPTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OPERATOR')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'OPERATOR'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'OPERATOR'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'APPROVETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'APPROVETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'APPROVETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_LICENCE')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_PS_BAS_LICENCE', 'column', 'REMARK'
go

/*==============================================================*/
/* Table: T_PS_BAS_MATERIALSINFO                                */
/*==============================================================*/
create table T_PS_BAS_MATERIALSINFO (
   MCODE                int                  not null,
   PSCODE               int                  null,
   MTYPE                varchar(50)          null,
   MNAME                varchar(50)          null,
   MAXUSEVALUE          float                null,
   MUNIT                varchar(20)          null,
   PERCENT_S            float                null,
   TOXIC                varchar(200)         null,
   OTHERINFO            varchar(100)         null,
   constraint PK_T_PS_BAS_MATERIALSINFO primary key nonclustered (MCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_MATERIALSINFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-鍘熼敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鍘熼敓鏂ゆ嫹閿熸枻鎷烽敓杈冭揪鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鍘熼敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXUSEVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MAXUSEVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熺粸鐧告嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MAXUSEVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MUNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MUNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂綅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'MUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERCENT_S')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'PERCENT_S'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰厓閿熸枻鎷峰崰閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'PERCENT_S'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TOXIC')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'TOXIC'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熷彨璁规嫹閿熷彨鐚存嫹閿熺即鍒嗙》鎷峰崰閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'TOXIC'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_MATERIALSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_MATERIALSINFO', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_BAS_PRODUCTSINFO                                 */
/*==============================================================*/
create table T_PS_BAS_PRODUCTSINFO (
   PCODE                int                  not null,
   PSCODE               int                  null,
   PRODUCTNAME          varchar(50)          null,
   PEID                 int                  null,
   DVALUE               float                null,
   PUNIT                varchar(20)          null,
   PLAN_PRODUCT_TIME    float                null,
   OTHER_PRUDUCTINFO    varchar(100)         null,
   constraint PK_T_PS_BAS_PRODUCTSINFO primary key nonclustered (PCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_PRODUCTSINFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷峰搧閿熸枻鎷锋伅', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰搧閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRODUCTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PRODUCTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰搧閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PRODUCTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PEID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PEID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰厓id',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PEID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'DVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'DVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PUNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PUNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂綅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PLAN_PRODUCT_TIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PLAN_PRODUCT_TIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熺粸鎲嬫嫹閿燂拷(h)',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'PLAN_PRODUCT_TIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_PRODUCTSINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHER_PRUDUCTINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'OTHER_PRUDUCTINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰搧閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_BAS_PRODUCTSINFO', 'column', 'OTHER_PRUDUCTINFO'
go

/*==============================================================*/
/* Table: T_PS_EDS_PRODUCTUNIT                                  */
/*==============================================================*/
create table T_PS_EDS_PRODUCTUNIT (
   PRODUCTUNITID        int                  not null,
   PRODUCTUINT_NAME     varchar(100)         null,
   SVGNAME              varchar(100)         null,
   OTHER_SVGINFO        varchar(200)         null,
   PSCODE               int                  null,
   constraint PK_T_PS_EDS_PRODUCTUNIT primary key nonclustered (PRODUCTUNITID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_EDS_PRODUCTUNIT') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷疯閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰厓', 
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_EDS_PRODUCTUNIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRODUCTUNITID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'PRODUCTUNITID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰厓id',
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'PRODUCTUNITID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_EDS_PRODUCTUNIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRODUCTUINT_NAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'PRODUCTUINT_NAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷疯閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰厓閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'PRODUCTUINT_NAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_EDS_PRODUCTUNIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SVGNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'SVGNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷疯閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'SVGNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_EDS_PRODUCTUNIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHER_SVGINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'OTHER_SVGINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'OTHER_SVGINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_EDS_PRODUCTUNIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_EDS_PRODUCTUNIT', 'column', 'PSCODE'
go

/*==============================================================*/
/* Table: T_PS_ENV_MAN_PUBLICINFO                               */
/*==============================================================*/
create table T_PS_ENV_MAN_PUBLICINFO (
   INFOID               int                  not null,
   PSCODE               int                  null,
   FORM                 varchar(300)         null,
   INFOTIME             varchar(50)          null,
   CONTENT              varchar(600)         null,
   OTHERINFO            varchar(300)         null,
   constraint PK_T_PS_ENV_MAN_PUBLICINFO primary key nonclustered (INFOID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_ENV_MAN_PUBLICINFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹瑕侀敓鏂ゆ嫹-閿熸枻鎷锋伅閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_PUBLICINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'INFOID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'INFOID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋伅id',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'INFOID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_PUBLICINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_PUBLICINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FORM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'FORM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰紡',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'FORM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_PUBLICINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'INFOTIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'INFOTIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鏃堕敓鏂ゆ嫹璇橀敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'INFOTIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_PUBLICINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONTENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'CONTENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'CONTENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_PUBLICINFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_PUBLICINFO', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_ENV_MAN_REPORT                                   */
/*==============================================================*/
create table T_PS_ENV_MAN_REPORT (
   REPORTID             int                  not null,
   PSCODE               int                  null,
   CONTENT              varchar(300)         null,
   FREQ                 varchar(300)         null,
   OTHERINFO            varchar(300)         null,
   constraint PK_T_PS_ENV_MAN_REPORT primary key nonclustered (REPORTID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_ENV_MAN_REPORT') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹瑕侀敓鏂ゆ嫹-鎵ч敓鍙唻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_REPORT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REPORTID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'REPORTID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'REPORTID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_REPORT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_REPORT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONTENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'CONTENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'CONTENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_REPORT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FREQ')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'FREQ'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻緝鎲嬫嫹棰戦敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'FREQ'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_REPORT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_REPORT', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_ENV_MAN_STANDBOOK                                */
/*==============================================================*/
create table T_PS_ENV_MAN_STANDBOOK (
   SBOOKID              int                  not null,
   PSCODE               int                  null,
   ETYPE                varchar(50)          null,
   PARAMETER            varchar(50)          null,
   RECORD_CONETENT      varchar(100)         null,
   RECORD_FREQ          varchar(50)          null,
   RECORD_FORM          varchar(50)          null,
   OTHERINFO            varchar(100)         null,
   constraint PK_T_PS_ENV_MAN_STANDBOOK primary key nonclustered (SBOOKID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_ENV_MAN_STANDBOOK') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹瑕侀敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍙伴敓缁炵》鎷峰綍', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SBOOKID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'SBOOKID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鍙伴敓缁炵》鎷峰綍id',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'SBOOKID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'ETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鍙伴敓缁炵》鎷峰綍閿熸枻鎷锋柦閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'ETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PARAMETER')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'PARAMETER'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'PARAMETER'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RECORD_CONETENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'RECORD_CONETENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰綍閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'RECORD_CONETENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RECORD_FREQ')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'RECORD_FREQ'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰綍棰戦敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'RECORD_FREQ'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RECORD_FORM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'RECORD_FORM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰綍閿熸枻鎷峰紡',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'RECORD_FORM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_ENV_MAN_STANDBOOK')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_ENV_MAN_STANDBOOK', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_GAS_POINTLIST                                    */
/*==============================================================*/
create table T_PS_GAS_POINTLIST (
   PSCODE               int                  null,
   POINTCODE            varchar(50)          not null,
   POINTNAME            varchar(50)          null,
   POLLUTENAME          varchar(100)         null,
   LONGITUDE            float                null,
   LATITUDE             float                null,
   OUTPOINTHEIGHT       float                null,
   PFKNJ                float                null,
   OTHERINFO            varchar(100)         null,
   POINTTYPE            varchar(50)          null,
   REMARK               varchar(200)         null,
   constraint PK_T_PS_GAS_POINTLIST primary key nonclustered (POINTCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_GAS_POINTLIST') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷�-閿熻剼鏀惧彛浼欐嫹閿熸枻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧恈ode',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧彛鎲嬫嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POINTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧尅鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POINTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'LONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'LONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'LATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '绾敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'LATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OUTPOINTHEIGHT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'OUTPOINTHEIGHT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹绛掗敓绔鎷�(閿熸枻鎷�)',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'OUTPOINTHEIGHT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PFKNJ')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'PFKNJ'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹绛掗敓鏂ゆ嫹閿熸枻鎷烽敓鑺傛拝鎷�(閿熸枻鎷�)',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'PFKNJ'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'OTHERINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POINTTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧尅鎷烽敓鏂ゆ嫹閿燂拷 閿熸枻鎷疯閿熻剼鏀惧尅鎷�,涓�閿熸枻鎷烽敓鑴氭斁鍖℃嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'POINTTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'REMARK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'REMARK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋敞',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POINTLIST', 'column', 'REMARK'
go

/*==============================================================*/
/* Table: T_PS_GAS_POLLUTE_COUNT                                */
/*==============================================================*/
create table T_PS_GAS_POLLUTE_COUNT (
   POINTCODE            varchar(50)          not null,
   TYPE                 int                  not null,
   PSCODE               int                  null,
   POLLUTECODE          varchar(50)          not null,
   PERMIT_VALUE6        float                null,
   PERMIT_VALUE2        float                null,
   PERMIT_VALUE1        float                null,
   PERMIT_VALUE3        float                null,
   PERMIT_VALUE4        float                null,
   PERMIT_VALUE5        float                null,
   ROMISE_VALUE         float                null,
   constraint PK_T_PS_GAS_POLLUTE_COUNT primary key nonclustered (POINTCODE, POLLUTECODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_GAS_POLLUTE_COUNT') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷�-閿熻剼鍑ゆ嫹閿熸澃纭锋嫹', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀炬唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'TYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'TYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鍏ㄩ敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹缁囬敓鑴氬嚖鎷烽敓鏉扮》鎷� 鍏ㄩ敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹缁囬敓鑴氬嚖鎷烽敓鏉扮》鎷� 鍏ㄩ敓鏂ゆ嫹閿熻緝纭锋嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'TYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟code',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE6')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE6'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�6閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE6'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�2閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE1')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE1'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�1閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE1'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�3閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE4')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE4'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�4閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE4'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE5')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE5'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�5閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'PERMIT_VALUE5'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ROMISE_VALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'ROMISE_VALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍑ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍊�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_COUNT', 'column', 'ROMISE_VALUE'
go

/*==============================================================*/
/* Table: T_PS_GAS_POLLUTE_LIMIT                                */
/*==============================================================*/
create table T_PS_GAS_POLLUTE_LIMIT (
   PSCODE               int                  null,
   POINTCODE            varchar(50)          not null,
   POLLUTECODE          varchar(50)          not null,
   CONVALUE_LIMIT       float                null,
   RATEVALUE_LIMIT      float                null,
   PERMIT_VALUE6        varchar(50)          null,
   PERMIT_VALUE2        float                null,
   PERMIT_VALUE1        float                null,
   PERMIT_VALUE3        float                null,
   PERMIT_VALUE4        float                null,
   PERMIT_VALUE5        float                null,
   PROMISE_VALUE        float                null,
   constraint PK_T_PS_GAS_POLLUTE_LIMIT primary key nonclustered (POINTCODE, POLLUTECODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_GAS_POLLUTE_LIMIT') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷�-閿熸枻鎷烽敓鏂ゆ嫹缁囬敓鑴氬嚖鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓琛楋拷', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟code',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧彛鎲嬫嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONVALUE_LIMIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'CONVALUE_LIMIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鑴氼煉鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺丹g/m3閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'CONVALUE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RATEVALUE_LIMIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'RATEVALUE_LIMIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍑ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰�奸敓鏂ゆ嫹kg/h閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'RATEVALUE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE6')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE6'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧尅鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE6'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�2閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE1')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE1'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�1閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE1'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�3閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE4')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE4'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�4閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE4'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE5')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE5'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�5閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE5'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PROMISE_VALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PROMISE_VALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷疯閿熸枻鎷烽敓鏂ゆ嫹閿熻緝闈╂嫹閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT', 'column', 'PROMISE_VALUE'
go

/*==============================================================*/
/* Table: T_PS_GAS_POLLUTE_LIMIT_INORG                          */
/*==============================================================*/
create table T_PS_GAS_POLLUTE_LIMIT_INORG (
   POINTCODE            varchar(50)          not null,
   PSCODE               int                  null,
   POLL_PRODUCT_LINK    varchar(50)          null,
   POLLUTECODE          varchar(50)          not null,
   MEASURES             varchar(50)          null,
   STANDARDNAME         varchar(100)         null,
   DVALUE_LIMIT         float                null,
   PROMISE_VALUE        float                null,
   PERMIT_VALUE6        float                null,
   PERMIT_VALUE2        float                null,
   PERMIT_VALUE1        float                null,
   PERMIT_VALUE3        float                null,
   PERMIT_VALUE4        float                null,
   PERMIT_VALUE5        float                null,
   OTHERINFO            varchar(100)         null,
   constraint PK_T_PS_GAS_POLLUTE_LIMIT_INOR primary key nonclustered (POINTCODE, POLLUTECODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷�-閿熸枻鎷烽敓鏂ゆ嫹缁囬敓鑴氬嚖鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓琛楋拷', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹缁囬敓鑴氭斁鎲嬫嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟code',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLL_PRODUCT_LINK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'POLL_PRODUCT_LINK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓妗斾紮鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'POLL_PRODUCT_LINK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MEASURES')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'MEASURES'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷疯閿熸枻鎷锋煋閿熸枻鎷烽敓杞胯揪鎷锋柦',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'MEASURES'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'STANDARDNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'STANDARDNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '鎵ч敓鍙唻鎷峰噯閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'STANDARDNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DVALUE_LIMIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'DVALUE_LIMIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰噯閿熸枻鎷峰��(mg/m3)',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'DVALUE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PROMISE_VALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PROMISE_VALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹閿熻剼鍑ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍊�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PROMISE_VALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE6')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE6'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�6閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE6'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�2閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE1')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE1'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�1閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE1'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�3閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE4')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE4'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�4閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE4'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE5')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE5'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�5閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'PERMIT_VALUE5'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_INORG')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_INORG', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_GAS_POLLUTE_LIMIT_SPECIAL                        */
/*==============================================================*/
create table T_PS_GAS_POLLUTE_LIMIT_SPECIAL (
   POINTCODE            int                  not null,
   WTYPE                varchar(50)          not null,
   POINTTYPE            varchar(50)          not null,
   POLLUTECODE          varchar(50)          not null,
   PSCODE               int                  identity,
   SDATETIME            datetime             null,
   EDATETIME            datetime             null,
   CONVALUE_LIMIT       numeric              null,
   PROMISE_VALUEDD      numeric              null,
   PROMISE_VALUEYY      numeric              null,
   constraint PK_T_PS_GAS_POLLUTE_LIMIT_SPEC primary key nonclustered (POINTCODE, WTYPE, POINTTYPE, POLLUTECODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷�-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍊�', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍙ｈ揪鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'WTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓閰典紮鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鐫揪鎷烽敓鑺ュ垝瑕侀敓鏂ゆ嫹,閿熸枻鎷烽敓鏂ゆ嫹鏌撻敓鏂ゆ嫹搴旈敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'WTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'POINTTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧尅鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'POINTTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰簲涔嬪墠閿熸枻鎷穙rgid',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'SDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ц洞閿熺粸闄呮唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'SDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'EDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ф菠閿熸枻鎷烽敓缁炴唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'EDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONVALUE_LIMIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'CONVALUE_LIMIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鑴氼煉鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺丹g/m3閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'CONVALUE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PROMISE_VALUEDD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'PROMISE_VALUEDD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷疯緱閿熸枻鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺耽g/h閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'PROMISE_VALUEDD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PROMISE_VALUEYY')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'PROMISE_VALUEYY'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷疯矾閿熸枻鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺耽g/m)',
   'user', @CurrentUser, 'table', 'T_PS_GAS_POLLUTE_LIMIT_SPECIAL', 'column', 'PROMISE_VALUEYY'
go

/*==============================================================*/
/* Table: T_PS_GAS_PRODUCT_POLL_INFO                            */
/*==============================================================*/
create table T_PS_GAS_PRODUCT_POLL_INFO (
   INFOID               int                  not null,
   PSCODE               int                  null,
   PCODE                varchar(50)          null,
   PNAME                varchar(50)          null,
   POLL_PRUDUCT_LINK    varchar(50)          null,
   POLLUTETYPE          varchar(50)          null,
   EFORM                varchar(50)          null,
   ECODE                varchar(50)          null,
   ENAME                varchar(50)          null,
   SVGNAME              varchar(50)          null,
   FEASIBLE             varchar(50)          null,
   OTHEREQUIPINFO       varchar(100)         null,
   POINTCODE            varchar(50)          null,
   ISDEMAND             varchar(50)          null,
   ISPRIMARYPOINT       varchar(50)          null,
   OTHERINFO            varchar(200)         null,
   constraint PK_T_PS_GAS_PRODUCT_POLL_INFO primary key nonclustered (INFOID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷�-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸鑺傜偣锛岄敓鏂ゆ嫹鏌撻敓鏂ゅ強閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷锋伅閿熸枻鎷�', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'INFOID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'INFOID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋伅id',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'INFOID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'PCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鐭唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'PCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'PNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'PNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLL_PRUDUCT_LINK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'POLL_PRUDUCT_LINK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰簲閿熸枻鎷烽敓鏂ょ幆閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'POLL_PRUDUCT_LINK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'POLLUTETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'POLLUTETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EFORM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'EFORM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷烽敓鏂ゆ嫹寮� 閿熸枻鎷烽敓鏂ゆ嫹缁�,閿熸枻鎷烽敓鏂ゆ嫹缁�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'EFORM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鐭唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SVGNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'SVGNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'SVGNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FEASIBLE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'FEASIBLE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹涓洪敓鏂ゆ嫹閿熷彨纭锋嫹閿熸枻鎷� 閿熸枻鎷�,閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'FEASIBLE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHEREQUIPINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'OTHEREQUIPINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'OTHEREQUIPINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹缁囬敓鑴氭斁鍙ｆ唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISDEMAND')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ISDEMAND'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧尅鎷烽敓瑙掑嚖鎷烽敓鏂ゆ嫹閿熸彮顏庢嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ISDEMAND'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISPRIMARYPOINT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ISPRIMARYPOINT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍖℃嫹閿熸枻鎷烽敓閰碉綇鎷烽敓鏂ゆ嫹瑕侀敓鑴氭斁鍙ｏ綇鎷�',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'ISPRIMARYPOINT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_GAS_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_GAS_PRODUCT_POLL_INFO', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_LICENSE_MODIFY                                   */
/*==============================================================*/
create table T_PS_LICENSE_MODIFY (
   MID                  int                  not null,
   PSCODE               int                  null,
   DATATIME             datetime             null,
   MODIFY_CONMENT       varchar(50)          null,
   PRELICENSE_NO        varchar(300)         null,
   constraint PK_T_PS_LICENSE_MODIFY primary key nonclustered (MID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_LICENSE_MODIFY') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓琛椼倧鎷烽敓鏂ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熼摪纭锋嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_LICENSE_MODIFY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'MID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓绲燿',
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'MID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_LICENSE_MODIFY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_LICENSE_MODIFY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓缁炴唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_LICENSE_MODIFY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MODIFY_CONMENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'MODIFY_CONMENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'MODIFY_CONMENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_LICENSE_MODIFY')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRELICENSE_NO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'PRELICENSE_NO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓瑙掑府鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_LICENSE_MODIFY', 'column', 'PRELICENSE_NO'
go

/*==============================================================*/
/* Table: T_PS_MANUAL_TESTEQUIP                                 */
/*==============================================================*/
create table T_PS_MANUAL_TESTEQUIP (
   PSCODE               int                  null,
   MEID                 int                  not null,
   POINTCODE            varchar(50)          null,
   CONTENT              varchar(300)         null,
   POLLUTENAME          varchar(300)         null,
   MENAME               varchar(50)          null,
   ISNETWORK            varchar(10)          null,
   POSITION             varchar(50)          null,
   ISREQUIR             varchar(10)          null,
   MMETHODANDNUM        varchar(50)          null,
   MFREQ                varchar(50)          null,
   METHOD               varchar(300)         null,
   OTHERINFO            varchar(300)         null,
   constraint PK_T_PS_MANUAL_TESTEQUIP primary key nonclustered (MEID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_MANUAL_TESTEQUIP') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹瑕侀敓鏂ゆ嫹-閿熸枻鎷烽敓鍙》鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MEID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MEID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MEID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧彛鎲嬫嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONTENT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'CONTENT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'CONTENT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋柦閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISNETWORK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'ISNETWORK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熺殕璁规嫹閿熸枻鎷烽敓鏂ゆ嫹娆犻敓鏂ゆ嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'ISNETWORK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POSITION')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'POSITION'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熺殕璁规嫹閿熸枻鎷风崓娌у府鎷烽敓闃舵嫈浼欐嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'POSITION'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISREQUIR')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'ISREQUIR'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熺殕璁规嫹閿熸枻鎷烽敓鏂ゆ嫹閿熺粸鈺嬫嫹娆犻敓鏂ゆ嫹閿熻緝甯嫹瑁呴敓鏂ゆ嫹閿熷彨鈽呮嫹缁撮敓鏂ゆ嫹閿熼ズ鐧告嫹閿熸枻鎷疯閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'ISREQUIR'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MMETHODANDNUM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MMETHODANDNUM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鐧告嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MMETHODANDNUM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MFREQ')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MFREQ'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鐧告嫹閿熸枻鎷烽敓鐙＄鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'MFREQ'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'METHOD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'METHOD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鐧告嫹閿熻В瀹氶敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'METHOD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_MANUAL_TESTEQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_MANUAL_TESTEQUIP', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_SVG_PRODUCT_EQUIP                                */
/*==============================================================*/
create table T_PS_SVG_PRODUCT_EQUIP (
   PEID                 int                  not null,
   PECODE               varchar(50)          null,
   PENAME               varchar(50)          null,
   PRODUCTUNITID        int                  null,
   PCODE                int                  null,
   EFORM                int                  null,
   POLL_PRUDUCT_LINK    varchar(50)          null,
   POINTCODE            int                  null,
   PSCODE               int                  null,
   constraint PK_T_PS_SVG_PRODUCT_EQUIP primary key nonclustered (PEID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_SVG_PRODUCT_EQUIP') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PEID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PEID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦id',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PEID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鐭唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PRODUCTUNITID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PRODUCTUNITID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷峰厓id',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PRODUCTUNITID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰簲閿熸枻鎷峰搧id',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EFORM')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'EFORM'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷烽敓鏂ゆ嫹寮�1閿熸枻鎷烽敓鏂ゆ嫹缁�0閿熸枻鎷烽敓鏂ゆ嫹缁�',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'EFORM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLL_PRUDUCT_LINK')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'POLL_PRUDUCT_LINK'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰簲閿熸枻鎷烽敓鏂ょ幆閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'POLL_PRUDUCT_LINK'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰簲閿熻剼鏀惧尅鎷�',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP', 'column', 'PSCODE'
go

/*==============================================================*/
/* Table: T_PS_SVG_PRODUCT_EQUIP_PARAM                          */
/*==============================================================*/
create table T_PS_SVG_PRODUCT_EQUIP_PARAM (
   PARAMID              int                  not null,
   PARAMNAME            varchar(50)          null,
   PVALUE               float                null,
   PUNIT                varchar(20)          null,
   PEID                 int                  null,
   OTHERPARAMINFO       varchar(100)         null,
   PSCODE               int                  null,
   constraint PK_T_PS_SVG_PRODUCT_EQUIP_PARA primary key nonclustered (PARAMID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PARAMID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PARAMID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹id',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PARAMID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PARAMNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PARAMNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PARAMNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PUNIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PUNIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷蜂綅',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PUNIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PEID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PEID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦id',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PEID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERPARAMINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'OTHERPARAMINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'OTHERPARAMINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_SVG_PRODUCT_EQUIP_PARAM')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_SVG_PRODUCT_EQUIP_PARAM', 'column', 'PSCODE'
go

/*==============================================================*/
/* Table: T_PS_WAT_DPOINTLIST                                   */
/*==============================================================*/
create table T_PS_WAT_DPOINTLIST (
   POINTCODE            varchar(50)          not null,
   PSCODE               int                  null,
   POINTNAME            varchar(100)         null,
   LONGITUDE            float                null,
   LATITUDE             float                null,
   OUTRULE              varchar(50)          null,
   OUTWHERE             varchar(50)          null,
   EMISSION_PERIOD      varchar(50)          null,
   WLONGITUDE           float                null,
   WLATITUDE            float                null,
   OTHERINFO            varchar(100)         null,
   WATERAREALEVEL       varchar(50)          null,
   RECEIVINGWATER       varchar(50)          null,
   constraint PK_T_PS_WAT_DPOINTLIST primary key nonclustered (POINTCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_WAT_DPOINTLIST') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '姘撮敓鏂ゆ嫹鏌撻敓鏂ゆ嫹閿熻剼鍑ゆ嫹-鐩撮敓鏂ゆ嫹閿熻剼鏀惧尅鎷�', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍙ｆ唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'POINTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍖℃嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'POINTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'LONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'LONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'LATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '缁撮敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'LATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OUTRULE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'OUTRULE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熻剼鏀剧櫢鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'OUTRULE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OUTWHERE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'OUTWHERE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熻剼鍖℃嫹鍘婚敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'OUTWHERE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EMISSION_PERIOD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'EMISSION_PERIOD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋瓏閿熻剼鍑ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'EMISSION_PERIOD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WLONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'WLONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹姘撮敓钘夌粡閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'WLONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WLATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'WLATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹姘撮敓鏂ゆ嫹绾敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'WLATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'OTHERINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WATERAREALEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'WATERAREALEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹姘撮敓钘夊姛閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鐩敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'WATERAREALEVEL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_DPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'RECEIVINGWATER')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'RECEIVINGWATER'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹姘撮敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_DPOINTLIST', 'column', 'RECEIVINGWATER'
go

/*==============================================================*/
/* Table: T_PS_WAT_IDPOINTLIST                                  */
/*==============================================================*/
create table T_PS_WAT_IDPOINTLIST (
   POINTCODE            varchar(50)          not null,
   PSCODE               int                  null,
   POINTNAME            varchar(100)         null,
   LONGITUDE            float                null,
   LATITUDE             float                null,
   OUTRULE              varchar(50)          null,
   OUTWHERE             varchar(50)          null,
   EMISSION_PERIOD      varchar(50)          null,
   POLLUTENAME          varchar(200)         null,
   POLLUTETYPE          varchar(50)          null,
   DVALUE_LIMIT         float                null,
   constraint PK_T_PS_WAT_IDPOINTLIST primary key nonclustered (POINTCODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_WAT_IDPOINTLIST') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '姘撮敓鏂ゆ嫹鏌撻敓鏂ゆ嫹閿熻剼鍑ゆ嫹-閿熸枻鎷烽敓鏂ゆ嫹娆ц洞閿燂拷', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍙ｆ唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POINTNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍖℃嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POINTNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LONGITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'LONGITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'LONGITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LATITUDE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'LATITUDE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '缁撮敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'LATITUDE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OUTRULE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'OUTRULE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熻剼鏀剧櫢鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'OUTRULE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OUTWHERE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'OUTWHERE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熻剼鍖℃嫹鍘婚敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'OUTWHERE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EMISSION_PERIOD')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'EMISSION_PERIOD'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋瓏閿熻剼鍑ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'EMISSION_PERIOD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋按閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POLLUTETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋按閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'POLLUTETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_IDPOINTLIST')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DVALUE_LIMIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'DVALUE_LIMIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鎻紮鎷疯儰閿熸枻鎷烽敓楗烘拝鎷烽敓鏂ゆ嫹娆х枱閿熼樁瀵傤煉鎷烽敓绲/l',
   'user', @CurrentUser, 'table', 'T_PS_WAT_IDPOINTLIST', 'column', 'DVALUE_LIMIT'
go

/*==============================================================*/
/* Table: T_PS_WAT_POLLUTE_COUNT                                */
/*==============================================================*/
create table T_PS_WAT_POLLUTE_COUNT (
   PSCODE               int                  null,
   POINTTYPE            varchar(50)          null,
   POLLUTECODE          varchar(50)          not null,
   CONVALUE_LIMIT       varchar(50)          null,
   PERMIT_VALUE1        float                null,
   PERMIT_VALUE2        float                null,
   PERMIT_VALUE3        float                null,
   PERMIT_VALUE4        float                null,
   PERMIT_VALUE5        float                null,
   constraint PK_T_PS_WAT_POLLUTE_COUNT primary key nonclustered (POLLUTECODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_WAT_POLLUTE_COUNT') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '姘撮敓鏂ゆ嫹鏌撻敓鏂ゆ嫹閿熻剼鍑ゆ嫹-閿熻剼鏀惧悎纭锋嫹閿熸枻鎷锋伅', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'POINTTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍖℃嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'POINTTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONVALUE_LIMIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'CONVALUE_LIMIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鑴氼煉鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺丹g/m3閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'CONVALUE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE1')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE1'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�1閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE1'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�2閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�3閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE4')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE4'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�4閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE4'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_COUNT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE5')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE5'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�5閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_COUNT', 'column', 'PERMIT_VALUE5'
go

/*==============================================================*/
/* Table: T_PS_WAT_POLLUTE_LIMIT                                */
/*==============================================================*/
create table T_PS_WAT_POLLUTE_LIMIT (
   PSCODE               int                  null,
   POINTCODE            varchar(50)          not null,
   POINTTYPE            varchar(50)          null,
   POLLUTECODE          varchar(50)          not null,
   CONVALUE_LIMIT_U     float                null,
   PERMIT_VALUE1        float                null,
   PERMIT_VALUE2        float                null,
   PERMIT_VALUE3        float                null,
   PERMIT_VALUE4        float                null,
   PERMIT_VALUE5        float                null,
   constraint PK_T_PS_WAT_POLLUTE_LIMIT primary key nonclustered (POINTCODE, POLLUTECODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_WAT_POLLUTE_LIMIT') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '姘撮敓鏂ゆ嫹鏌撻敓鏂ゆ嫹閿熻剼鍑ゆ嫹-閿熻剼鍑ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熻锟�', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍙ｆ唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'POINTTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍖℃嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'POINTTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONVALUE_LIMIT_U')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'CONVALUE_LIMIT_U'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鑴氼煉鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺丹g/m3閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'CONVALUE_LIMIT_U'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE1')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE1'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�1閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE1'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�2閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�3閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE4')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE4'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�4閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE4'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PERMIT_VALUE5')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE5'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓琛楃鎷烽敓锟�5閿熸枻鎷穞/a',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT', 'column', 'PERMIT_VALUE5'
go

/*==============================================================*/
/* Table: T_PS_WAT_POLLUTE_LIMIT_SPECIAL                        */
/*==============================================================*/
create table T_PS_WAT_POLLUTE_LIMIT_SPECIAL (
   POINTCODE            int                  not null,
   WTYPE                int                  not null,
   PSCODE               int                  null,
   POLLUTECODE          varchar(50)          not null,
   SDATETIME            datetime             null,
   EDATETIME            datetime             null,
   CONVALUE_LIMIT       float                null,
   PROMISE_VALUE        float                null,
   OTHERINFO            varchar(200)         null,
   constraint PK_T_PS_WAT_POLLUTE_LIMIT_SPEC primary key nonclustered (POINTCODE, WTYPE, POLLUTECODE)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋按閿熸枻鎷锋煋閿熸枻鎷烽敓鑴氬嚖鎷�-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍊�', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧尅鎷稢ODE',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'WTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹1閿熸枻鎷烽敓鐫揪鎷烽敓鑺ュ垝瑕侀敓鏂ゆ嫹2閿熸枻鎷烽敓鏂ゆ嫹鏌撻敓鏂ゆ嫹搴旈敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'WTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'SDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ц洞閿熺粸闄呮唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'SDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'EDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'EDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ф菠閿熸枻鎷烽敓缁炴唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'EDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CONVALUE_LIMIT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'CONVALUE_LIMIT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹娆ч敓鑴氼煉鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺丹g/L閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'CONVALUE_LIMIT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PROMISE_VALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'PROMISE_VALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷疯緱閿熸枻鎷烽敓鏂ゆ嫹閿熻纰夋嫹閿熺耽g/d閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'PROMISE_VALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_POLLUTE_LIMIT_SPECIAL')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_WAT_POLLUTE_LIMIT_SPECIAL', 'column', 'OTHERINFO'
go

/*==============================================================*/
/* Table: T_PS_WAT_PRODUCT_POLL_INFO                            */
/*==============================================================*/
create table T_PS_WAT_PRODUCT_POLL_INFO (
   INFOID               int                  not null,
   PSCODE               int                  null,
   WATTYPE              varchar(50)          null,
   POLLUTETYPE          varchar(50)          null,
   OUTWHERE             varchar(50)          null,
   OUTRULE              varchar(50)          null,
   ECODE                varchar(50)          null,
   ENAME                varchar(50)          null,
   SVGNAME              varchar(50)          null,
   POINTCODE            varchar(50)          null,
   FEASIBLE             varchar(10)          null,
   OTHEREQUIPINFO       varchar(100)         null,
   ISDEMAND             varchar(10)          null,
   ISPRIMARYPOINT       varchar(50)          null,
   OTHERINFO            varchar(200)         null,
   constraint PK_T_PS_WAT_PRODUCT_POLL_INFO primary key nonclustered (INFOID)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷蜂笟閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅-閿熸枻鎷�-閿熸枻鎷锋按閿熸枻鎷烽敓鏂ゆ嫹閿熼ズ鎾呮嫹閿涳拷 閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷锋伅', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'INFOID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'INFOID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋伅id',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'INFOID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PSCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'PSCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹涓�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'PSCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'WATTYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'WATTYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋按閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'WATTYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTETYPE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'POLLUTETYPE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'POLLUTETYPE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OUTWHERE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OUTWHERE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍑ゆ嫹鍘婚敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OUTWHERE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OUTRULE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OUTRULE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀剧櫢鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OUTRULE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鐭唻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SVGNAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'SVGNAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'SVGNAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧彛鎲嬫嫹閿燂拷',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'FEASIBLE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'FEASIBLE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻鍑ゆ嫹涓洪敓鏂ゆ嫹閿熷彨纭锋嫹閿熸枻鎷� 閿熸枻鎷�,閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'FEASIBLE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHEREQUIPINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OTHEREQUIPINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋柦閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OTHEREQUIPINFO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISDEMAND')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ISDEMAND'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鏀惧尅鎷烽敓瑙掑嚖鎷烽敓鏂ゆ嫹閿熸彮顏庢嫹閿燂拷 閿熸枻鎷�,閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ISDEMAND'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ISPRIMARYPOINT')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ISPRIMARYPOINT'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熻剼鍖℃嫹閿熸枻鎷烽敓閰碉綇鎷烽敓鏂ゆ嫹瑕侀敓鑴氭斁鍙ｏ綇鎷�',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'ISPRIMARYPOINT'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_WAT_PRODUCT_POLL_INFO')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OTHERINFO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OTHERINFO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷锋伅',
   'user', @CurrentUser, 'table', 'T_PS_WAT_PRODUCT_POLL_INFO', 'column', 'OTHERINFO'
go


if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_GAS_DATAHH')
            and   type = 'U')
   drop table T_PS_BAS_GAS_DATAHH
go

/*==============================================================*/
/* Table: T_PS_BAS_GAS_DATAHH                                   */
/*==============================================================*/
create table T_PS_BAS_GAS_DATAHH (
   POINTCODE            varchar(50)                  not null,
   POLLUTECODE          varchar(50) not null,
   DATATIME             datetime             not null,
   MAXVALUE             float     null,
   MINVALUE            float     null,
   DATAVALUE            float    null,
   AUDITVALUE		float null,
   DATASTATUS		char(1) null,
   ISVALIDED		int null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50) null,
   ROUNDINGOFFVALUE     float     null,
   constraint PK_T_PS_BAS_GAS_DATAHH primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_GAS_DATAHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷�-閿熸枻鎷烽敓鏂ゆ嫹灏忔椂閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鎹锋唻鎷疯瘑浣�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'DATAFLAG'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ROUNDINGOFFVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'ROUNDINGOFFVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风害鍊�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATAHH', 'column', 'ROUNDINGOFFVALUE'
go



if exists (select 1
            from  sysobjects
           where  id = object_id('T_PS_BAS_GAS_DATADD')
            and   type = 'U')
   drop table T_PS_BAS_GAS_DATADD
go

/*==============================================================*/
/* Table: T_PS_BAS_GAS_DATADD                                   */
/*==============================================================*/
create table T_PS_BAS_GAS_DATADD (
   POINTCODE            varchar(50)                  not null,
   POLLUTECODE          varchar(50) not null,
   DATATIME             datetime             not null,
   MAXVALUE             float     null,
   MINVALUE            float     null,
   DATAVALUE            float    null,
   AUDITVALUE		float null,
   DATASTATUS		char(1) null,
   ISVALIDED		int null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50) null,
   ROUNDINGOFFVALUE     float     null,
   constraint PK_T_PS_BAS_GAS_DATADD primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_PS_BAS_GAS_DATADD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷�-閿熸枻鎷烽敓鏂ゆ嫹灏忔椂閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鎹锋唻鎷疯瘑浣�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'DATAFLAG'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_PS_BAS_GAS_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ROUNDINGOFFVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'ROUNDINGOFFVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风害鍊�',
   'user', @CurrentUser, 'table', 'T_PS_BAS_GAS_DATADD', 'column', 'ROUNDINGOFFVALUE'
go



if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_DATAHH')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_DATAHH
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_DATAHH                                   */
/*==============================================================*/
create table T_ENV_MONI_AIR_DATAHH (
   POINTCODE            varchar(50)                  not null,
   POLLUTECODE          varchar(50) not null,
   DATATIME             datetime             not null,
   MAXVALUE             float     null,
   MINVALUE            float     null,
   DATAVALUE            float    null,
   AUDITVALUE		float null,
   DATASTATUS		char(1) null,
   ISVALIDED		int null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50) null,
   ROUNDINGOFFVALUE     float     null,
   constraint PK_T_ENV_MONI_AIR_DATAHH primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_DATAHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷�-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹灏忔椂閿熸枻鎷烽敓鏂ゆ嫹', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鎹锋唻鎷疯瘑浣�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'DATAFLAG'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATAHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ROUNDINGOFFVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'ROUNDINGOFFVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风害鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATAHH', 'column', 'ROUNDINGOFFVALUE'
go



if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_DATADD')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_DATADD
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_DATADD                                   */
/*==============================================================*/
create table T_ENV_MONI_AIR_DATADD (
   POINTCODE            varchar(50)                  not null,
   POLLUTECODE          varchar(50) not null,
   DATATIME             datetime             not null,
   MAXVALUE             float     null,
   MINVALUE            float     null,
   DATAVALUE            float    null,
   AUDITVALUE		float null,
   DATASTATUS		char(1) null,
   ISVALIDED		int null,
   UPDATETIME           datetime             null,
   DATAFLAG             varchar(50) null,
   ROUNDINGOFFVALUE     float     null,
   constraint PK_T_ENV_MONI_AIR_DATADD primary key nonclustered (POINTCODE, POLLUTECODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_DATADD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋煋婧愰敓鏂ゆ嫹閿熸枻鎷�-閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POINTCODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POINTCODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POINTCODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTECODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POLLUTECODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'POLLUTECODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MAXVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MAXVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓琛楋拷',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MAXVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'MINVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MINVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰皬鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'MINVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷峰��',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAVALUE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATAFLAG')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAFLAG'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鎹锋唻鎷疯瘑浣�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'DATAFLAG'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_DATADD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ROUNDINGOFFVALUE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'ROUNDINGOFFVALUE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷风害鍊�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_DATADD', 'column', 'ROUNDINGOFFVALUE'
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR1_AQIHH')
            and   type = 'U')
   drop table T_ENV_MONI_AIR1_AQIHH
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AIR_AQIDD')
            and   type = 'U')
   drop table T_ENV_MONI_AIR_AQIDD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AREA_AQIDD')
            and   type = 'U')
   drop table T_ENV_MONI_AREA_AQIDD
go

if exists (select 1
            from  sysobjects
           where  id = object_id('T_ENV_MONI_AREA_AQIHH')
            and   type = 'U')
   drop table T_ENV_MONI_AREA_AQIHH
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR1_AQIHH                                 */
/*==============================================================*/
create table T_ENV_MONI_AIR1_AQIHH (
   CODE                 varchar(50) not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 float     null,
   PM10                 float     null,
   PM10IAQI             int                  null,
   SO2                  float     null,
   SO2IAQI              int                  null,
   NO2                  float     null,
   NO2IAQI              int                  null,
   CO                   float     null,
   COIAQI               int                  null,
   O3                   float     null,
   O3IAQI               int                  null,
   O38                  float     null,
   O38IAQI              int                  null,
   AVGVALUE_PM25        int                  null,
   AVGVALUE_PM10        int                  null,
   POLLUTENAME          varchar(50) null,
   AIRID                int                  null,
   UPDATETIME           datetime             null,
   LEVEL                int                  null,
   constraint PK_T_ENV_MONI_AIR1_AQIHH primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR1_AQIHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋仾顫嫹閿熸枻鎷烽敓绱窺I閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍏�閿熸枻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AVGVALUE_PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AVGVALUE_PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AVGVALUE_PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AVGVALUE_PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AIRID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AIRID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'AIRID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR1_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'LEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '0閿熸枻鎷烽敓鏂ゆ嫹1鐪侀敓鏂ゆ嫹 2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷烽敓鏂ゆ嫹4閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR1_AQIHH', 'column', 'LEVEL'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AIR_AQIDD                                  */
/*==============================================================*/
create table T_ENV_MONI_AIR_AQIDD (
   CODE                 varchar(50) not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 float     null,
   PM10                 float     null,
   PM10IAQI             int                  null,
   SO2                  float     null,
   SO2IAQI              int                  null,
   NO2                  float     null,
   NO2IAQI              int                  null,
   CO                   float     null,
   COIAQI               int                  null,
   O3                   float     null,
   O3IAQI               int                  null,
   O38                  float     null,
   O38IAQI              int                  null,
   POLLUTENAME          varchar(50) null,
   AQIID                int                  null,
   UPDATETIME           datetime             null,
   LEVEL                int                  null,
   constraint PK_T_ENV_MONI_AIR_AQIDD primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AIR_AQIDD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋仾顫嫹閿熸枻鎷烽敓绱窺I閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍏�閿熸枻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQIID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'AQIID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'AQIID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AIR_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'LEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '0閿熸枻鎷烽敓鏂ゆ嫹1鐪侀敓鏂ゆ嫹 2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷烽敓鏂ゆ嫹4閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AIR_AQIDD', 'column', 'LEVEL'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AREA_AQIDD                                 */
/*==============================================================*/
create table T_ENV_MONI_AREA_AQIDD (
   CODE                 varchar(50) not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 float     null,
   PM10                 float     null,
   PM10IAQI             int                  null,
   SO2                  float     null,
   SO2IAQI              int                  null,
   NO2                  float     null,
   NO2IAQI              int                  null,
   CO                   float     null,
   COIAQI               int                  null,
   O3                   float     null,
   O3IAQI               int                  null,
   O38                  float     null,
   O38IAQI              int                  null,
   POLLUTENAME          varchar(50) null,
   AQIID                int                  null,
   UPDATETIME           datetime             null,
   LEVEL                int                  null,
   constraint PK_T_ENV_MONI_AREA_AQIDD primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AREA_AQIDD') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋仾顫嫹閿熸枻鎷烽敓绱窺I閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍏�閿熸枻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQIID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'AQIID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'AQIID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIDD')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'LEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '0閿熸枻鎷烽敓鏂ゆ嫹1鐪侀敓鏂ゆ嫹 2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷烽敓鏂ゆ嫹4閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIDD', 'column', 'LEVEL'
go

/*==============================================================*/
/* Table: T_ENV_MONI_AREA_AQIHH                                 */
/*==============================================================*/
create table T_ENV_MONI_AREA_AQIHH (
   CODE                 varchar(50) not null,
   DATATIME             datetime             not null,
   AQI                  int                  null,
   PM25IAQI             int                  null,
   PM25                 float     null,
   PM10                 float     null,
   PM10IAQI             int                  null,
   SO2                  float     null,
   SO2IAQI              int                  null,
   NO2                  float     null,
   NO2IAQI              int                  null,
   CO                   float     null,
   COIAQI               int                  null,
   O3                   float     null,
   O3IAQI               int                  null,
   O38                  float     null,
   O38IAQI              int                  null,
   AVGVALUE_PM25        int                  null,
   AVGVALUE_PM10        int                  null,
   POLLUTENAME          varchar(50) null,
   AIRID                int                  null,
   UPDATETIME           datetime             null,
   LEVEL                int                  null,
   constraint PK_T_ENV_MONI_AREA_AQIHH primary key nonclustered (CODE, DATATIME)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('T_ENV_MONI_AREA_AQIHH') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '閿熸枻鎷锋仾顫嫹閿熸枻鎷烽敓绱窺I閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹鍏�閿熸枻鎷烽敓鏂ゆ嫹閿燂拷', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CODE')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'CODE'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'CODE'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'DATATIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'DATATIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'DATATIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷锋煋鎸囬敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM25IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM25IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'PM10IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM10IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'PM10IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'PM10IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'SO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'SO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'SO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'SO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'SO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'SO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'NO2'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'NO2'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'NO2IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'NO2IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'NO2IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'NO2IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CO')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'CO'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'CO',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'CO'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'COIAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'COIAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'COIAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'COIAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O3'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O3'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O3IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O3IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O3IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O3IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O38'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O38'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'O38IAQI')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O38IAQI'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   'O38IAQI',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'O38IAQI'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM25')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AVGVALUE_PM25'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM25',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AVGVALUE_PM25'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AVGVALUE_PM10')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AVGVALUE_PM10'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '24灏忔椂閿熸枻鎷峰��-PM10',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AVGVALUE_PM10'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'POLLUTENAME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'POLLUTENAME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熶茎鍖℃嫹閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'POLLUTENAME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'AIRID')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AIRID'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹閿熸枻鎷烽敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'AIRID'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'UPDATETIME')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'UPDATETIME'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '閿熸枻鎷烽敓鏂ゆ嫹鏃堕敓鏂ゆ嫹',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'UPDATETIME'
go

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('T_ENV_MONI_AREA_AQIHH')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LEVEL')
)
begin
   declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_dropextendedproperty 'MS_Description', 
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'LEVEL'

end


select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '0閿熸枻鎷烽敓鏂ゆ嫹1鐪侀敓鏂ゆ嫹 2閿熸枻鎷烽敓鏂ゆ嫹3閿熸枻鎷烽敓鏂ゆ嫹4閿熸枻鎷烽敓锟�',
   'user', @CurrentUser, 'table', 'T_ENV_MONI_AREA_AQIHH', 'column', 'LEVEL'
go


ALTER TABLE [dbo].[T_DIC_AREACODE] ADD [AREADESC] varchar(500) NULL 
GO

IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'T_DIC_AREACODE', 
'COLUMN', N'AREADESC')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'娴犲绮�'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'T_DIC_AREACODE'
, @level2type = 'COLUMN', @level2name = N'AREADESC'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'娴犲绮�'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'T_DIC_AREACODE'
, @level2type = 'COLUMN', @level2name = N'AREADESC'
GO

ALTER TABLE [dbo].[T_DIC_AREACODE] ADD [PICDIR_LIST] varchar(100) NULL 
GO

IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'T_DIC_AREACODE', 
'COLUMN', N'PICDIR_LIST')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'閸ュ墽澧栭弬鍥︽lid閸掓銆�'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'T_DIC_AREACODE'
, @level2type = 'COLUMN', @level2name = N'PICDIR_LIST'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'閸ュ墽澧栭弬鍥︽lid閸掓銆�'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'T_DIC_AREACODE'
, @level2type = 'COLUMN', @level2name = N'PICDIR_LIST'
GO


ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [REGISTER_ADDRESS] varchar(300) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [ENTERADDRESS] varchar(300) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [WAT_POLLUTES] varchar(500) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [GAS_POLLUTES] varchar(500) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [GAS_EMISSION_FORM] varchar(500) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [WAT_EMISSION_FORM] varchar(500) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [GAS_STANDARD_NAME] varchar(500) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [WAT_STANDARD_NAME] varchar(500) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [LONGITUDE] numeric(18,5) 
GO

ALTER TABLE [dbo].[T_PS_BAS_ENTERLIST] ALTER COLUMN [LATITUDE] numeric(18,5) 
GO

ALTER TABLE [dbo].[T_PS_WAT_POLLUTE_COUNT] ALTER COLUMN [PSCODE] int NOT NULL 
GO

ALTER TABLE [dbo].[T_PS_WAT_POLLUTE_COUNT] ALTER COLUMN [POINTTYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL 
GO

ALTER TABLE [dbo].[T_PS_WAT_POLLUTE_COUNT] DROP CONSTRAINT [PK_T_PS_WAT_POLLUTE_COUNT] 
GO

ALTER TABLE [dbo].[T_PS_WAT_POLLUTE_COUNT] ADD CONSTRAINT [PK_T_PS_WAT_POLLUTE_COUNT] PRIMARY KEY NONCLUSTERED ([POLLUTECODE], [POINTTYPE], [PSCODE])
GO

ALTER TABLE [dbo].[T_PS_ENV_MAN_STANDBOOK] ALTER COLUMN [RECORD_CONETENT] varchar(500) COLLATE Chinese_PRC_CI_AS 
GO

ALTER TABLE [dbo].[T_DIC_AREACODE] ALTER COLUMN [LONGITUDE] numeric(18,6) 
GO

ALTER TABLE [dbo].[T_DIC_AREACODE] ALTER COLUMN [LATITUDE] numeric(18,6) 
GO

ALTER TABLE [dbo].[T_PS_BAS_GAS_DATAHH] ALTER COLUMN [POINTCODE] varchar(50) 
GO
ALTER TABLE [dbo].[T_PS_BAS_WAT_DATAHH] ALTER COLUMN [POINTCODE] varchar(50) 
GO

/*==============================================================*/
/* Table: T_PS_FACT_PUNISHRECORD                                   */
/*==============================================================*/
CREATE TABLE [dbo].[NewTable] (
[PSCODE] int NOT NULL ,
[PUNISHDATE] datetime NULL ,
[DESCRIBE] varchar(50) NULL ,
[PUNISHTYPE] varchar(50) NULL ,
PRIMARY KEY ([PSCODE])
)

GO

IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'NewTable', 
'COLUMN', N'PSCODE')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'企业编号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'PSCODE'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'企业编号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'PSCODE'
GO

IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'NewTable', 
'COLUMN', N'PUNISHDATE')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'违法时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'PUNISHDATE'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'违法时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'PUNISHDATE'
GO

IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'NewTable', 
'COLUMN', N'DESCRIBE')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'违法描述'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'DESCRIBE'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'违法描述'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'DESCRIBE'
GO

IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'NewTable', 
'COLUMN', N'PUNISHTYPE')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'违法类型'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'PUNISHTYPE'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'违法类型'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'NewTable'
, @level2type = 'COLUMN', @level2name = N'PUNISHTYPE'
GO

ALTER TABLE [dbo].[T_PS_FACT_PUNISHRECORD] DROP CONSTRAINT [PK__T_PS_FAC__49602D867692FDAE] 
GO

ALTER TABLE [dbo].[T_PS_FACT_PUNISHRECORD] ALTER COLUMN [PUNISHDATE] datetime NOT NULL 
GO

ALTER TABLE [dbo].[T_PS_FACT_PUNISHRECORD] ADD CONSTRAINT [PK__T_PS_FAC__49602D867692FDAE] PRIMARY KEY ([PSCODE], [PUNISHDATE])
GO

SET IDENTITY_INSERT [dbo].[T_BAS_MENU] ON
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) 
VALUES(40, '许可证核发管理系统', NULL, 'framework/images/system40.png', NULL, '40', 1, 107, 1);
INSERT INTO T_BAS_MENU (MENUID, MENUNAME, MENUURL, MENUPIC, PID, MENUCODE, STYPE, ORDERNUM, MSTATUS) 
VALUES(50, '污染源精细化管理系统', NULL, 'framework/images/system50.png', NULL, '50', 1, 106, 1);
SET IDENTITY_INSERT [dbo].[T_BAS_MENU] OFF

INSERT INTO  VALUES (40, 1, -1, 1, NULL, NULL, 1);
INSERT INTO T_BAS_USERMENU VALUES (50, 1, -1, 1, NULL, NULL, 1);

UPDATE T_BAS_MENU SET MENUNAME='排污许可智能分析系统' WHERE MENUID=10;
UPDATE T_BAS_MENU SET MENUNAME='排污许可证管理系统' WHERE MENUID=40;
UPDATE T_BAS_MENU SET MENUNAME='环境信息公开系统' WHERE MENUID=30;
UPDATE T_BAS_MENU SET MENUNAME='污染源全生命周期信息管理系统' WHERE MENUID=20;

SET IDENTITY_INSERT [dbo].[T_BAS_MENU] ON
INSERT INTO T_BAS_MENU ([MENUID], [MENUNAME], [MENUURL], [MENUPIC], [PID], [MENUCODE], [STYPE], [ORDERNUM], [MSTATUS]) VALUES (101024, '二维码管理', '', 'framework/images/plsMenuIcon/qrcode.png', NULL, '20', NULL, 10, 1);
INSERT INTO T_BAS_MENU ([MENUID], [MENUNAME], [MENUURL], [MENUPIC], [PID], [MENUCODE], [STYPE], [ORDERNUM], [MSTATUS]) VALUES (101029, '许可证信息公开', '/WebReport/ReportServer?formlet=plsReport%2LicenceInfoOvert.frm', NULL, 101027, '30', NULL, 2, 1);
INSERT INTO T_BAS_MENU ([MENUID], [MENUNAME], [MENUURL], [MENUPIC], [PID], [MENUCODE], [STYPE], [ORDERNUM], [MSTATUS]) VALUES (101025, '排口二维码', '/pls/views/pls/equipQRCode.html', NULL, 101024, '20', NULL, 30, 1);
INSERT INTO T_BAS_MENU ([MENUID], [MENUNAME], [MENUURL], [MENUPIC], [PID], [MENUCODE], [STYPE], [ORDERNUM], [MSTATUS]) VALUES (101027, '信息公开', NULL, NULL, NULL, '30', NULL, 10, 1);
SET IDENTITY_INSERT [dbo].[T_BAS_MENU] OFF

INSERT INTO T_BAS_USERMENU VALUES (101024, 1, -1, 1, NULL, NULL, 1);
INSERT INTO T_BAS_USERMENU VALUES (101025, 1, -1, 1, NULL, NULL, 1);
INSERT INTO T_BAS_USERMENU VALUES (101027, 1, -1, 1, NULL, NULL, 1);
INSERT INTO T_BAS_USERMENU VALUES (101029, 1, -1, 1, NULL, NULL, 1);